DEV Community

Discussion on: Capitalize first letter in every sentence?

Collapse
 
stevematdavies profile image
Stephen Matthew Davies • Edited

Perhaps consider looking at regex and groupings. With regex you can target each single letter that falls after a whitespace, you can do this via the String replace() function. Then there is no need to split iterate and join.

developer.mozilla.org/en-US/docs/W...

Collapse
 
devdrake0 profile image
Si

Regex is indeed powerful, but I wouldn't recommend a beginner try to learn it.