Javascript String pretty()

Description

Javascript String pretty()


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



PreviousNext

Related