Created
May 9, 2017 03:32
-
-
Save nicholasxjy/cd4c06bea982a018b14d520e82d2110a to your computer and use it in GitHub Desktop.
titlecase string in js
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
function titleCase(str) { | |
str = str.toLowerCase() | |
return str.charAt(0).toUpperCase() + str.slice(1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment