The contains
function is a Boolean expression in which a specified collection of values is searched for a given single value. If the single value is found within the collection, contains
evaluates to "true." If it is not found, contains
evaluates to false. The notContains
tag is the opposite: if the value is found, it evaluates to "false." If it is not found, it evaluates to "true." Both functions work anywhere Perl is accepted.
Syntax
contains
contains(item to match,collection to check against)
notContains
notContains(item to match,collection to check against)
Examples
Check option IDs
Strings
Strings can also be used as inputs, but they must be surrounded by single quotes.
In selection weighting
A primary use of contains
and notContains
is with selectby: weight
variables. In such cases, certain arbitrary options might need higher weights than other options.
Q2SEL will always select 'Primary Brand', if available, followed by 'Secondary Brands'.
Comments
0 comments
Please sign in to leave a comment.