erknrio of Programming Guanches
7/30/2015 - 11:08 AM

Humanize

Humanize

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