[Javascript] trim, to camel case, to dashed, and to underscore
Trim String1 2 3 String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, ""); };To Camel Case1 2 3 String.prototype.toCamel = function(){ return this.replace(/(\-[a-z])/g, function($1){return $1.toUpperCase().replace('-','');}); };To Dashed from Camel Case1 2 3 String.prototype.toDash = function(){ return this.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();}); };To Un..