To Camel Case
Converts a string to camel case.
Category | Strings |
Author | Pol Gubau |
Since | 1.0.0 |
Last Updated | 2025-03-15 |
Type | Sync |
Compatibility | Universal |
Example
Input
toCamelCase('hello-world')
Output:
'helloWorld'
Input
toCamelCase('hello_world')
Output:
'helloWorld'
Return
Returns the camel-cased string.
Type: string
Props
Name | Type | Default | Required | Description |
---|---|---|---|---|
str | string | null | Yes | The string to convert to camel case. |
Notes
This function converts strings with underscores or hyphens into camel case format.
Tags
- string
- camelCase
- conversion