Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (11 sloc) 313 Bytes
function titleCase(str) {
var myArray = str.toLowerCase().split(" ");
for(var i = 0; i < myArray.length; i++) {
myArray[i] = myArray[i].charAt(0).toUpperCase() + myArray[i].substring(1);
}
str=myArray.join(" ");
return str;
//return myArray;
//return str;
}
titleCase("I'm a little tea pot");
You can’t perform that action at this time.