Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Uppercase first letter of variable

var str = "hello world";
str = str.toLowerCase().replace(/[a-z]/g, function(letter) {
    return letter.toUpperCase();
});
alert(str); //Displays "Hello World"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Uppercase #letter #variable
ADD COMMENT
Topic
Name
1+7 =