Explore your training options and get exclusive tuition discounts Get Started

X

Back

Global navigation

JavaScript: Capitalize First Letter of Each Word in a String

Comments (1)
  1. Dmitry says:

    Hey, nice article, there is a small type though… In the 3rd method it should be square brackets:

    let regex = /[^|\s]\S/g

    otherwise each word after the space begins with a space 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

Start your Tech training
Find, compare, and enroll in the right training program. Save on Tuition.
View my matches