string-has

1.0.0 • Public • Published

string-has Build Status

Check whether string contains another string, or one of many strings. Supports locale and case-sensitive / case-insensitive matching.

Install

$ npm install string-has

Usage

const has = require('string-has');
 
has('unicorns', 'corn');
//=> true
 
has('unicorns', ['uni', 'corn']);
//=> true

API

has(input, substring, options?)

input

Type: string

String to be checked against

substring

Type: string or array[string]

Single substring or array of substrings for input to be tested against

options

Type: object

caseSensitive

Type: boolean Default: true

Should matching be case sensitive, or not.

locale

Type: string Default: en-US

Locale to use when converting input and substring to lowercase for case in-sensitive matching.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i string-has

    Weekly Downloads

    5

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.73 kB

    Total Files

    4

    Last publish

    Collaborators

    • nijikokun