Created
March 24, 2019 02:22
-
-
Save jwadhwani/be18212f2f34b0470f7a105506af3d11 to your computer and use it in GitHub Desktop.
String to first letter uppercase, rest lower case
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
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