https://github.com/dustinspecker/string-contains-string
Check if one of two strings contains the other
https://github.com/dustinspecker/string-contains-string
Last synced: 3 months ago
JSON representation
Check if one of two strings contains the other
- Host: GitHub
- URL: https://github.com/dustinspecker/string-contains-string
- Owner: dustinspecker
- License: mit
- Created: 2016-04-10T22:42:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T20:12:59.000Z (about 8 years ago)
- Last Synced: 2025-02-16T09:26:33.710Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# string-contains-string
[](https://badge.fury.io/js/string-contains-string)
[](https://travis-ci.org/dustinspecker/string-contains-string)
[](https://coveralls.io/r/dustinspecker/string-contains-string?branch=master)[](https://codeclimate.com/github/dustinspecker/string-contains-string)
[](https://david-dm.org/dustinspecker/string-contains-string/#info=dependencies&view=table)
[](https://david-dm.org/dustinspecker/string-contains-string/#info=devDependencies&view=table)[](http://makeapullrequest.com)
[](http://commitizen.github.io/cz-cli/)
[](https://github.com/semantic-release/semantic-release)> Check if one of two strings contains the other
## Install
```
npm install --save string-contains-string
```## Usage
```javascript
import stringContainsString from 'string-contains-string'stringContainsString('hello', 'world')
// => falsestringContainsString('hello', 'ell')
// => truestringContainsString('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](https://github.com/dustinspecker)