Here you can find the source of toCamelCase()
String.prototype.toCamelCase = function(){ return this//from w ww.j ava2 s .c om .toLowerCase() .replace(/(\s+[a-z])/g, function($1) { return $1.toUpperCase().replace(' ', ''); } ); }
String.prototype.toCamelCase = function () { return this.replace(/^\s+|\s+$/g, '').toLowerCase().replace(/([\s\-\_][a-z0-9])/g, function ($1) { return $1.replace(/\s/, '').toUpperCase(); }).replace(/\W/g, ''); };
String.prototype.toCamelCase = function() { words = this.split(' ') var upperCased = ''; for (var i = 0; i < words.length; i++) { for (var y = 0; y < words[i].length; y++) { if (y == 0) { upperCased += words[i][y].toUpperCase(); else { ...
String.prototype.toCamelCase = function () { return this.split(/\W+/g).map(function (w) { return w.substr(0, 1).toUpperCase() + w.substr(1); }).join(' '); };
String.prototype.toCamelCase = function(){ return this.replace(/(\_[a-z])/g, function($1){return $1.toUpperCase().replace('_','');}); };
String.prototype.toCamelCase = function(){ return this.replace(/[-_]([a-z])/g, function (g) { return g[1].toUpperCase(); }); };
String.prototype.toCamelCase = function () { return this.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, index) { if (+match === 0) return ""; return index == 0 ? match.toLowerCase() : match.toUpperCase(); }); };
String.prototype.toCamelCase = function() { var parts = this.split('-'), rtr = "", part; for (var i = 0; i < parts.length; i++) { part = parts[i]; rtr += (i === 0) ? part.toLowerCase() : part[0].toUpperCase()+part.slice(1).toLowerCase(); return rtr; ...
String.prototype.toCamelCase = function() { return this.replace(/-([a-z])/g, function (m, w) { return w.toUpperCase(); });
String.prototype.toCamelCase = function() { return this.replace(/(^|\s)[a-z]/g, function (x) { return x.toUpperCase() });