String.prototype.toCamelCase = function() { return this.toString() .replace(/([A-Z]+)/g, function(m,l){ return l.substr(0,1).toUpperCase() + l.toLowerCase().substr(1,l.length); }) .replace(/[-_s](.)/g, function(m, l){ return l.toUpperCase(); }); };