Created
June 5, 2017 14:38
-
-
Save anteburazer/7680d434c0c02caa7aea05044271b286 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
/** | |
* Capitalizes the first character in given string | |
* @param s | |
*/ | |
export function capitalize(s: string) { | |
if (!s || typeof s !== 'string') return s; | |
return s && s[0].toUpperCase() + s.slice(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment