Verifies that all needles are contained in value
Install
Install all functions of strman
yarn add strman
or just the containsAll function
yarn add strman.containsall
Usage
import { containsAll } from 'strman'
// OR
import containsAll from 'strman.containsall'
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
String | The input string |
||
needles |
Array.<String> | An array of strings which are checked to be contained within |
||
caseSensitive |
Boolean |
<optional> |
true | Use case (in-)sensitive matching |
- Source:
Returns:
True if all needles
are contained
- Type
- Boolean
Example
const title = 'Daniel Leite'
const needles = ['Leite', 'Daniel']
containsAll(title, needles)
// => true