Javascript String toProperName()
toProperName()
String.prototype.toProperName = function() { return this.replace(/^[a-z]|[A-Z]/g, function(v, i) { return i === 0 ? v.toUpperCase() : " " + v.toUpperCase(); });/* w w w. ja va 2 s . co m*/ };