Last active
July 27, 2017 10:30
-
-
Save heimdallrj/41c327147010526694a73bcd729acda7 to your computer and use it in GitHub Desktop.
This file contains 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
toTitleCase(str: string) { | |
console.log('str: ', str); | |
return str.toLowerCase().split(' ').map(function(word) { | |
return (word.charAt(0).toUpperCase() + word.slice(1)); | |
}).join(' '); | |
} | |
https://medium.freecodecamp.org/three-ways-to-title-case-a-sentence-in-javascript-676a9175eb27 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment