Licence
ISC
Version
1.0.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0
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 } = require('npm-stringutils');
- isBlank: Returns true if string is null, empty or whitespaces, else returns false.
if (isBlank(" your string ")) {
...
} 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.