Skip to content

Instantly share code, notes, and snippets.

@anteburazer
Created June 5, 2017 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anteburazer/7680d434c0c02caa7aea05044271b286 to your computer and use it in GitHub Desktop.
Save anteburazer/7680d434c0c02caa7aea05044271b286 to your computer and use it in GitHub Desktop.
/**
* 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