Javascript String underscorize()

Description

Javascript String underscorize()

String.prototype.underscorize = function() {
  return this.replace(/([A-Z])/g, function($1) {
    return "_" + $1.toLowerCase();
  }).replace(/^_/g, "");
};



PreviousNext

Related