How do I make the first letter of a string uppercase, but not change the case of any of the other letters?
For example:
\"this is a test\"
Capitalize the first letter of all words in a string:
function ucFirstAllWords( str ) { var pieces = str.split(" "); for ( var i = 0; i < pieces.length; i++ ) { var j = pieces[i].charAt(0).toUpperCase(); pieces[i] = j + pieces[i].substr(1); } return pieces.join(" "); }