Version: v0.7.1 - Beta.  We welcome contributors & feedback.


contains($matchString, $options = {}) -> boolean


Check for the existence of $matchString and return true or false.

If $options is -ignoreCase it will match both upper and lowercase versions of each character.

//= true

//= false

'abcdef'.contains('CDE', -ignoreCase)
//= true

Regex Patterns

If you need to match a pattern within the string, you can use match instead.

'abc 123 xyz'.match(r'\d+')
//= '123'

// i = ignore case
'123 Abc Xyz'.match(r'(abc|def)'i)
//= 'Abc'

See Also