Here you can find the source of toDashCase()
String.prototype.toDashCase = function() { return this//from w w w . ja va2s .co m .replace(/^[A-Z]/, ($1) => { return $1.toLowerCase(); }) .replace(/([A-Z])/g, ($1) => { return '-'+$1.toLowerCase(); }); };
String.prototype.dasherize = function() { return this.replace(/_/g, '-'); };
String.prototype.dasherize = function() { return this.replace(/_/g, "-"); };
String.prototype.dasherize = function() { return this.replace(/_/g, '-'); };
String.prototype.toDash = function(){ return this.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();}); };
String.prototype.toDash = function () { var str = this.replace(/([A-Z])/g, function ($1) { return "-" + $1.toLowerCase(); }); return (str[0] == '-' ? str.substring(1) : str); };
String.prototype.toDashedCase = function() { return this.replace(/([A-Z])/g, function($1){return '-'+$1.toLowerCase();}); };