function ucFirst(a) { return a.substr(0,1).toUpperCase() + a.substr(1); } function titleCaseWord(a) { return a.substr(0,1).toUpperCase() + a.substr(1).toLowerCase(); } function titleCase(s) { let title = '', a, word; a = s.split(' '); for (i = 0; i < a.length; i++) { if (title != '') title += ' '; title += titleCaseWord(a[i]); } return title; }
Programming Tips - How do make a string title case (first letter uppercase) in javaScript?
Date: 2009jun30
Language: javaScript
Q. How do make a string title case (first letter uppercase) in javaScript?
A.