Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

uppercase first letter of each word javascript

const str = 'FIDEURAM VITA';

function capitalize(str) {
  return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
}

const caps = str.split(' ').map(capitalize).join(' ');
caps; // 'Fideuram Vita'
Source by masteringjs.io #
 
PREVIOUS NEXT
Tagged: #uppercase #letter #word #javascript
ADD COMMENT
Topic
Name
2+5 =