Javascript String capitalize(lower)
'use strict';//ww w . j ava 2 s. co m String.prototype.capitalize = function(lower) { return (lower ? this.toLowerCase() : this).replace( /(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); };
String.prototype.capitalize = function(lower) { return (lower ? this.toLowerCase() : this).replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); };
/**//from w ww.j av a2s .c om * From: http://stackoverflow.com/questions/2332811/capitalize-words-in-string */ String.prototype.capitalize = function(lower) { return (lower ? this.toLowerCase() : this).replace(/(?:^|\s)\S/g, function( a) { return a.toUpperCase(); }); };