Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript uppercase first character of each word

const uppercaseWords = str => str.replace(/^(.)|s+(.)/g, c => c.toUpperCase());

// Example
uppercaseWords('hello world');      // 'Hello World'
 
PREVIOUS NEXT
Tagged: #javascript #uppercase #character #word
ADD COMMENT
Topic
Name
6+6 =