Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 days 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 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T20:12:59.000Z (over 7 years ago)
- Last Synced: 2024-08-09T10:29:40.134Z (3 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
[![NPM version](https://badge.fury.io/js/string-contains-string.svg)](https://badge.fury.io/js/string-contains-string)
[![Build Status](https://travis-ci.org/dustinspecker/string-contains-string.svg)](https://travis-ci.org/dustinspecker/string-contains-string)
[![Coverage Status](https://img.shields.io/coveralls/dustinspecker/string-contains-string.svg)](https://coveralls.io/r/dustinspecker/string-contains-string?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/string-contains-string/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/string-contains-string)
[![Dependencies](https://david-dm.org/dustinspecker/string-contains-string.svg)](https://david-dm.org/dustinspecker/string-contains-string/#info=dependencies&view=table)
[![DevDependencies](https://david-dm.org/dustinspecker/string-contains-string/dev-status.svg)](https://david-dm.org/dustinspecker/string-contains-string/#info=devDependencies&view=table)[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](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)