contains

.contains value:{Dynamic} element:{Dynamic} -> Boolean

Checks whether a value contains another one:

  • a collection contains element if any of its elements equals it, in the same way as equals;

  • a dictionary contains element if it is one of its keys;

  • any other value, such as a string, contains element if its text contains the text of element.

.var {letters}
- A
- B

.letters::contains {B} <!-- true -->

.contains {Quarkdown} {ark} <!-- true -->

Return

whether value contains element

Parameters

value

collection, dictionary or string to search in

element

element, key or text to search for

Chaining

This function is designed to be chained with other function calls:
Dynamic::contains element:{Dynamic} -> Boolean