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