string-includes-x

2.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

string-includes-x

Determines whether one string may be found within another string.

module.exportsboolean

This method determines whether one string may be found within another string, returning true or false as appropriate.

Kind: Exported member
Returns: boolean - true if the given string is found anywhere within the search string; otherwise, false if not.
Throws:

  • TypeError If target is null or undefined.
  • TypeError If searchString is a RegExp.
Param Type Description
string string The target string.
searchString string A string to be searched for within the target string.
[position] number The position within the string at which to begin searching for searchString.(defaults to 0).

Example

import strIncludes from 'string-includes-x';
 
const str = 'To be, or not to be, that is the question.';
 
includes(str, 'To be'); // true
includes(str, 'question'); // true
includes(str, 'nonexistent'); // false
includes(str, 'To be', 1); // false
includes(str, ('TO BE'); // false

/string-includes-x/

    Package Sidebar

    Install

    npm i string-includes-x

    Weekly Downloads

    4

    Version

    2.1.2

    License

    MIT

    Unpacked Size

    349 kB

    Total Files

    11

    Last publish

    Collaborators

    • xotic750