List operators
Lists are usefull when combined with specific Operators:
- contains any of: Checks if any of the list elements are present in the string.
"elem" contains any of ["el", "abc"]
istrue
because"elem"
contains"el"
"elem" contains any of ["element", "abc"]
isfalse
because"el"
doesn't contain"elemn"
or"abc"
- does not contain any of: Checks if none of the list elements are present in the string.
- returns the opposite of the above evaluation
- is in: Checks if the specified element is present in the list.
"elem" is in ["element", "abc"]
isfalse
because"elem"
is not an element of the list"elem" contains any of ["elem", "abc"]
istrue
because"elem"
is an element of the list
- not in: Checks if the specified element is not present in the list.
- returns the opposite of the above evaluation
Operator | Left operand | Right operand |
---|---|---|
contains any of | string | List of strings |
does not contain any of | string | List of strings |
is in | string | List of strings |
not in | string | List of strings |
Case sensitivity
The contains any of, does not contain any of operators are not case sensitive, while the is in and not in operators are case sensitive.
Examples
- Check if a value
is in
a list
Updated 7 months ago