Elementals.js

Latest Version: 3.4 PRODUCTION 18 November 2017

Method String.stripCamel

Calling Convention:
String.stripCamel([delimiter])
Parameters:
delimiter optional, default "-"
The character to be added to a string before any upper-case characters before converting them to lower-case.
Returns:
A string result where "camelCase" has been stripped, with delimiter added as appropriate

Example #1, no delimiter

JavaScript
var jsName = "quickTestVariable";
console.log(jsName.stripCamel());
Output
quick-test-variable

Example #2, with delimiter

JavaScript
var jsName = "quickTestVariable";
console.log(jsName.stripCamel('+'));
Output
quick+test+variable

Example #3, empty delimiter

JavaScript
var jsName = "quickTestVariable";
console.log(jsName.stripCamel(''));
Output
quicktestvariable

Advertisement