hyphenate (source code)
- Curried: false
- Failsafe status: alternative available
The hyphenate
function converts strings that contain underscores, spaces, and
camelCase strings into hyphenated strings
string
: The string to be hyphenated.fallbackString
: value to be returned if string is empty.
hyphenate("Hello World"); // "hello-world"
hyphenate("hello_world"); // "hello-world"
hyphenate("helloWorld"); // "hello-world"