Created
June 25, 2014 08:26
-
-
Save lgoldstien/333f5b59a38d1c220f9c to your computer and use it in GitHub Desktop.
Javascript Text Methods: capitaliseFirst
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
/** | |
* capitaliseFirst | |
* | |
* Makes the first letter of a string a capital | |
* @param {string} | |
* @return {string} | |
*/ | |
capitaliseFirst = function (text) { | |
return text.substring(0, 1).toUpperCase() + text.substring(1); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment