underscore (str) String
public
More general than decamelize. Returns the lower_case_and_underscored form of a string.
'innerHTML'.underscore(); // 'inner_html' 'action_name'.underscore(); // 'action_name' 'css-class-name'.underscore(); // 'css_class_name' 'my favorite items'.underscore(); // 'my_favorite_items' 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice'
Parameters:
-
str
String
- The string to underscore.
Returns:
-
String
- the underscored string.
Please login to continue.