1.0.1 • Published 6 years ago

npm-stringutils v1.0.1

Weekly downloads
49
License
ISC
Repository
github
Last release
6 years ago

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');
  1. isBlank: Returns true if string is null, empty or whitespaces, else returns false.
    if (isBlank(" your string ")) {
        ...
    } else {
        ...
    }
  1. isEmpty: Returns true is string is null or empty, else returns false.

  2. getLength: Returns length of the given string.

  3. getCount: Returns count of the given character in the given string.

  4. getTitleCase: Returns title cased value for the given string, i.e, first character of all the words will be capitalized.