Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

uppercase in word javascript

function toTitleCase(str) {
    return str.replace(/wS*/g, function(txt){
        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #uppercase #word #javascript
ADD COMMENT
Topic
Name
1+9 =