Answers for "uppercase first letter word js"

3

javascript uppercase first character of each word

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

// Example
uppercaseWords('hello world');      // 'Hello World'
Posted by: Guest on July-03-2020
1

js capitalize first letter of each word

const titleCase = title => title
    .split(/ /g).map(word =>
        `${word.substring(0,1).toUpperCase()}${word.substring(1)}`)
    .join(" ");
Posted by: Guest on August-03-2020

Code answers related to "uppercase first letter word js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language