Skip to content

Instantly share code, notes, and snippets.

@jasp402
Last active August 5, 2020 21:26
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 jasp402/2a72358a90bd433cd15e700d62190def to your computer and use it in GitHub Desktop.
Save jasp402/2a72358a90bd433cd15e700d62190def to your computer and use it in GitHub Desktop.
JS-PackTools | capitalLetter
const { capitalLetter } = require('js-packtools')();
//πŸ‘‡πŸ» Capitalize only the first letter
capitalLetter('hello word'); //β‡’ Hello word
//πŸ‘‡πŸ» Capitalize all the first letter of each word in the sentence
capitalLetter('hello word', true); //β‡’ Hello Word
//πŸ’‘ ---- tips: you can use prototyping ----
//πŸ‘‡πŸ» Capitalize only the first letter
'hello word'.capitalLetter(); //β‡’ Hello word
//πŸ‘‡πŸ» Capitalize all the first letter of each word in the sentence
'hello word'.capitalLetter(true); //β‡’ Hello Word
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment