Created
March 27, 2017 17:22
-
-
Save glosik/37c71b2a68320be1013f470373aef055 to your computer and use it in GitHub Desktop.
capitalize
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
hs.capitalizeSentence = function(string){ | |
var words = string.split(' '); | |
for (i = 0; i < words.length; i++){ | |
words[i] = words[i].charAt(0).toUpperCase()+ words[i].slice(1); | |
} | |
return words.join(' '); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment