Javascript String upperFirst()

Description

Javascript String upperFirst()


String.prototype.upperFirst = function() {
  return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}



PreviousNext

Related