apps-script-utils 2.1.1 Help

toProperCase

function toProperCase(value: string, options: ToProperCaseOptions = {}): string;

Word boundaries are those of a regular expression, so "hello WORLD" becomes "Hello World". Punctuation and separators are left exactly where they were.

Parameters

Parameter

Type

Description

value

string

The string to convert. It must not be empty.

options (optional) = {}

ToProperCaseOptions

trim trims the string and collapses runs of whitespace into single spaces.

Returns

string — the converted string.

Throws

Exception

Condition

EmptyStringException

the value is not a string, or is empty.

Examples

Converting

toProperCase("hello WORLD"); // => "Hello World"

See also

Source

src/lang/string/toProperCase.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.