Search Docs
toKebabCase
Converts the str to kebab-case, where words are separated by hyphens and all letters are lowercase.
str
import { toKebabCase } from 'funtool/string' toKebabCase('helloWorld'); // ✅ 'hello-world' toKebabCase('HelloWorld'); // ✅ 'hello-world' toKebabCase('myXMLParser'); // ✅ 'my-xml-parser' toKebabCase('MyXMLParser'); // ✅ 'my-xml-parser' toKebabCase('hello_world'); // ✅ 'hello-world' toKebabCase('userID_token'); // ✅ 'user-id-token'
function toKebabCase(str: string): string
string