check if collection contains given value
Parameters
contains? collection :string :dictionary :block :range
value :any
Attributes
at | :integer | check at given location within collection |
Returns
Examples
copy
arr: [1 2 3 4]
contains? arr 5
contains? arr 2
copy
user: #[
name: "John"
surname: "Doe"
]
contains? dict "John"
contains? dict "Paul"
contains? keys dict "name"
copy
contains? "hello" "x"
contains? "hello" `h`
copy
contains?.at:1 "hello" "el"
contains?.at:4 "hello" `o`
copy
print contains?.at:2 ["one" "two" "three"] "two"
print contains?.at:1 ["one" "two" "three"] "two"
Related