Elementals.js

Latest Version: 3.4 PRODUCTION 18 November 2017

Method String.toCamel

Calling Convention:
String.toCamel([delimiter])
Parameters:
delimiter optional, default "-"
The character to be stripped from the string where the next character will be converted to upper-case.
Returns:
A string result where delimiter has been removed, the next letter capitolized.

Example #1, no delimiter

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

Example #2, with delimiter

JavaScript
var jsName = "quick-test+variable";
console.log(jsName.toCamel('+'));
Output
quick-testVariable

Advertisement