function (text) {
return text.toString().toLowerCase()
.replace(/[_-]/g, ' ')
.replace(/(?:^|\s)\S/g, function(a) {
return a.toUpperCase();
});
}
Last active
October 22, 2015 18:57
-
-
Save kylealwyn/ff7ac6c8a3a91d235bb8 to your computer and use it in GitHub Desktop.
capitalize all words of a string
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment