What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-22 22:47:06
javascript capitalize
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
-
Other 2021-10-19 16:54:06
make first letter uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-10-12 23:17:06
js first letter to uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
TypeScript 2021-10-12 06:07:06
capitalize first letter of all word typescript
//Altered, "capitalize all words of a string" (javascript by Grepper on Jul 22 2019) answer to compatible with TypeScript var myString = 'abcd abcd'; capitalizeWords(text){ return text.replace(/(?:^|\s)\S/g,(res)=>{ return res.toUpperCase... Add solution