apps-script-utils 2.1.1 Help

toCamelCase

function toCamelCase(value: string, options: ToCamelCaseOptions = {}): string;

Each word is capitalised, the separators between words are dropped, and the first letter is lowered unless firstWordToLowerCase is false. With clean left on, anything that is not a letter or a digit is removed as well.

Word boundaries are the ones a regular expression sees, so spaces and hyphens separate words but an underscore does not: "user_first_name" comes back as "userfirstname", not "userFirstName".

Parameters

Parameter

Type

Description

value

string

The string to convert. It must not be empty.

options (optional) = {}

ToCamelCaseOptions

clean strips non-alphanumeric characters (on by default); firstWordToLowerCase lowers the first letter (on by default).

Returns

string — the converted string.

Throws

Exception

Condition

EmptyStringException

the value is not a string, or is empty.

Examples

Converting

toCamelCase("Hello world! How are you?"); // => "helloWorldHowAreYou" toCamelCase("Hello world!", { firstWordToLowerCase: false }); // => "HelloWorld" toCamelCase("user_first_name"); // => "userfirstname"

See also

Source

src/lang/string/toCamelCase.ts

23 September 2026

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