• function

can.underscore

 

Takes a CamelCase or mixedCase string and underscores the string on the capital letter. If parts of the string are not CamelCase or mixedCase, it will not change them. can.underscore will lower case the entire string as well.

can.underscore("OneTwo") //-> "one_two"
can.underscore("OneTwo threeFour") //-> "one_two three_four"

can.underscore(str)

Parameters

  1. str {String}

    The string to underscore

Returns

{String}

the underscored string

Underscores a string.

can.underscore("OneTwo") //-> "one_two"