npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

string-includes

2.0.0 • Public • Published

string-includes Build Status

ES6 String.includes() ponyfill

Ponyfill: A polyfill that doesn't overwrite the native method

Install

$ npm install --save string-includes

Usage

const stringIncludes = require('string-includes');
 
stringIncludes('unicorns and rainbows', 'unicorns');
//=> true
 
stringIncludes('unicorns and rainbows', 'rainbows');
//=> true
 
stringIncludes('unicorns and rainbows', 'unicorns', 1);
//=> false

API

stringIncludes(string, searchString, [position])

string

Type: string

The string to search in.

searchString

Type: string

A string to be searched for.

position

Type: Number
Default: 0

The position in this string at which to begin searching for searchString.

License

MIT © Kevin Martensson

install

npm i string-includes

Downloadsweekly downloads

24

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability