Javascript String toPermaLink()

Description

Javascript String toPermaLink()

String.prototype.toPermaLink = function() {
 var unsafeCharactersRegEx = /[^a-z0-9]*$/gi;
 var str = this.toString();
 return str.replace(unsafeCharactersRegEx, '').toLowerCase().replaceAll(' ','-');
}



PreviousNext

Related