toCamelCase
Converts a string to camelCase format.
Syntax
typescript
toCamelCase(str: string): stringParameters
| Parameter | Type | Description |
|---|---|---|
str | string | The input string. |
Returns
| Type | Description |
|---|---|
string | The string converted to camelCase. |
Example
typescript
toCamelCase("exemplo de string"); // "exemploDeString"
toCamelCase(" teste camel case "); // "testeCamelCase"
toCamelCase(""); // ""Notes
- Throws
TypeErrorif the argument is not a string. - Extra spaces are removed before conversion.
