Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created June 5, 2013 06:36
Show Gist options
  • Save hyonschu/5712012 to your computer and use it in GitHub Desktop.
Save hyonschu/5712012 to your computer and use it in GitHub Desktop.
function LetterCapitalize(str) {
var splits = str.split(" ");
for (var i=0;i<splits.length;i++) {
var tempvar = [];
tempvar = splits[i].split("")
var captemp = tempvar[0].toUpperCase();
tempvar[0] = captemp;
tempvar = tempvar.join("");
splits[i] = tempvar;
};
var str = splits.join(" ")
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment