Skip to content

Instantly share code, notes, and snippets.

@jwadhwani
Created March 24, 2019 02:22
Show Gist options
  • Save jwadhwani/be18212f2f34b0470f7a105506af3d11 to your computer and use it in GitHub Desktop.
Save jwadhwani/be18212f2f34b0470f7a105506af3d11 to your computer and use it in GitHub Desktop.
String to first letter uppercase, rest lower case
const toFirstUpperRestLowerCase = (str) => {
return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase();
};
const s = 'POINT';
console.log(toFirstUpperRestLowerCase(str)); //Point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment