Skip to content

Instantly share code, notes, and snippets.

@pketh
Created January 7, 2015 21:32
Show Gist options
  • Save pketh/981d4a7222cd7a2138e5 to your computer and use it in GitHub Desktop.
Save pketh/981d4a7222cd7a2138e5 to your computer and use it in GitHub Desktop.
Capitalize first letter
function capitalizeFirstLetter(string) {
var firstLetter = string.substring(0, 1);
var newString = firstLetter.toUpperCase() + string.substring(1,string.length);
return newString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment