Converts a given string to kebab-case.
The input string to convert.
The kebab-case version of the input string, or an empty string if input is falsy.
toKebabCase('helloWorld'); // "hello-world"toKebabCase('foo_bar-baz'); // "foo-bar-baz"toKebabCase(' SomeInputValue '); // "some-input-value"toKebabCase(undefined); // "" Copy
toKebabCase('helloWorld'); // "hello-world"toKebabCase('foo_bar-baz'); // "foo-bar-baz"toKebabCase(' SomeInputValue '); // "some-input-value"toKebabCase(undefined); // ""
Converts a given string to kebab-case.