To Kebab Case

Converts a string to kebab case.

CategoryStrings
AuthorPol Gubau
Since1.0.0
Last Updated2025-03-15
TypeSync
CompatibilityUniversal

Example

  • Input

    toKebabCase('helloWorld')

    Output:

    'hello-world'

Return

Returns the kebab-cased string.

Type: string

Props

NameTypeDefaultRequiredDescription
strstringnullYesThe string to convert to kebab case.

Notes

This function converts camelCase strings into kebab-case format.

Tags

  • string
  • kebabCase
  • conversion

Related