Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 592 Bytes

hyphenate.md

File metadata and controls

20 lines (14 loc) · 592 Bytes

hyphenate (source code)

  • Curried: false
  • Failsafe status: alternative available

The hyphenate function converts strings that contain underscores, spaces, and camelCase strings into hyphenated strings

Arguments:

  • string: The string to be hyphenated.
  • fallbackString: value to be returned if string is empty.

Usage:

hyphenate("Hello World"); //  "hello-world"
hyphenate("hello_world"); // "hello-world"
hyphenate("helloWorld"); // "hello-world"