can.hyphenate

  • function
 

Adds a hyphen before each uppercase letter and converts the entire string to lower case.

can.hyphenate(str)

Parameters

  1. str {String}

    The string to hyphenate.

Returns

{String}

The lowercase string with hyphens added before each letter that was uppercase in the source string.

can.hyphenate('helloWorld'); //-> Returns: 'hello-world'