I\'m trying to proper case a string in javascript - so far I have this code:
This doesn\'t seem to capitalize the first letter, and I\'m also stuck on how to lowercase all the l
This should work. Notice how I set newstr[i] to the desired output. Functions like .toUpperCase() do not affect the original string. They only return a new string with the desired property.
function titleCase(str) {
var newstr = str.split(" ");
for(i=0;i