NPM StringUtils
Simple NPM library to simplify common string operations.
Setup
npm install npm-stringutils
Usage
Import the required methods:
const isBlank isEmpty getLength getCount getTitleCase = ;
- isBlank: Returns true if string is null, empty or whitespaces, else returns false.
if ... else ...
-
isEmpty: Returns true is string is null or empty, else returns false.
-
getLength: Returns length of the given string.
-
getCount: Returns count of the given character in the given string.
-
getTitleCase: Returns title cased value for the given string, i.e, first character of all the words will be capitalized.