JavaScript Deep Dives

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 *

Tell us about you and we will match you with top rated bootcamps with flexible payment options, income sharing (ISAs), or money-back guarantees.

Career Karma

Find the right bootcamp for you

By continuing you indicate that you have read and agree to
Career Karma Terms of Service and Privacy Policy

A person sitting on a dark green chair with a laptop on their knee