For the complete documentation index, see llms.txt. This page is also available as Markdown.

BoxSetContains

Test whether a Set contains a given value using BoxLang value equality.

Returns true if the value is present, false otherwise.

Method Signature

BoxSetContains(set=[set], value=[any])

Arguments

Argument
Type
Required
Description
Default

set

set

true

The set to test.

value

any

true

The value to look for.

Examples

Test whether a Set contains a value

s = [ 1, 2, 3 ].toSet();
writeOutput( s.contains( 2 ) & "," & s.contains( 99 ) );

Result: true,false

Using the has alias

has is an alias for contains.

Result: true,false

Case-insensitive lookup (default)

Result: true

Last updated

Was this helpful?