contains

v1.0.0arrow_drop_down
v1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
26
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
489 B
determines whether string `str` ref contains substring `searchRef`.
2 contributors
Install contains as a package?
Copied
npm i @bit/bit.utils.string.contains
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
contains (
str:string,
searchStr:string
) : boolean

determines whether string str ref contains substring searchRef.

Example
contains('foo bar', 'bar') // => true
 contains('foo', 'bar') // => false
Arguments
str: string
searchStr: string
Returns
boolean

Test Summary

contains should return true as substring foo exists in foo bar

Pass

contains should return false as substring x do not exists in string foo

Pass
Help and resources