contains
Tests if a container contains a given value.
Syntax
-
contains(X, x)
-
X
is a container -
x
is any object
-
-
contains(X, x, ε)
-
X
is a container -
x
is any object -
ε
is a non-negative integer
-
Description
If X
is a container and x
any value, then contains(X, x)
returns true
iff X
contains an element with value identical to x
.
contains(X, x, ε)
has the same behaviour, but compares floating-point values with epsilon ε
if ε > 0
. If ε = 0
, a default (non-zero) epsilon is used.
Examples
Alice ≔ ExampleData("Alice in Wonderland");
contains(words(Alice) @ LowerCase, "perfunctorily")
false
contains(words(Alice) @ LowerCase, "splendidly")
true