npm-stringutils

1.0.1 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i npm-stringutils

      Weekly Downloads

      59

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      2.12 kB

      Total Files

      3

      Last publish

      Collaborators

      • ashwindmk