can.classize

  • function
can/map/setter
 

Make a string into a class name.

can.classize(str)

can.classize splits a string by underscores or dashes and capitalizes each part before joining them back together. This method is useful for taking HTML class names and getting the original Control name from them.

can.classize('my_control_name'); // 'MyControlName'

Parameters

  1. str {String}

    The string to transform.

Returns

{String}

The string as a class name.