Javascript String capitalizeEachLetter()
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(' '); };