Javascript String capitalizeEachLetter()

Description

Javascript String capitalizeEachLetter()

String.prototype.capitalizeEachLetter = function() {
    return this.toLowerCase()
        .split(' ')
        .map(function(word) {
            return word.capitalizeFirstLetter();
        })/*from w w  w  .  j  a va2  s . c  o m*/
        .join(' ');
};



PreviousNext

Related