Skip to content

dustinspecker/string-contains-string

Repository files navigation

string-contains-string

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

PRs Welcome Commitizen friendly semantic-release

Check if one of two strings contains the other

Install

npm install --save string-contains-string

Usage

import stringContainsString from 'string-contains-string'

stringContainsString('hello', 'world')
// => false

stringContainsString('hello', 'ell')
// => true

stringContainsString('ell', 'hello')
// => true

API

stringContainsString(str1, str2)

Returns a boolean if str1 contains str2 or str2 contains str1.

str1

type: string

A string to test.

str2

type: string

Another string to test.

LICENSE

MIT © Dustin Specker

About

Check if one of two strings contains the other

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •