Created
March 29, 2017 15:54
-
-
Save daronwolff/24ac953b8b0419b6e06611745e8e669d to your computer and use it in GitHub Desktop.
CapitalizeString and remove white spaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function capitalize(str) { | |
return str.replace(/\b\w/g, l => l.toUpperCase()) | |
.replace(/\s/g, ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment