uppercase first letter of variable

Solutions on MaxInterview for uppercase first letter of variable by the best coders in the world

showing results for - "uppercase first letter of variable"
Maite
26 Oct 2020
1var str = "hello world";
2str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
3    return letter.toUpperCase();
4});
5alert(str); //Displays "Hello World"