arrayContainsNoCase

Used to determine if a value is in the given array, case insensitive.

arrayContainsNoCase(array, value) → returns boolean

Member Function Syntax

someArray.containsNoCase(value)

Argument Reference

array array
Required

value any
Required

Compatibility

Lucee:

Returns index of first occurrence

ColdFusion:

Version 2016+ Member function only available in CF2021+

Examples
Sample code invoking the arrayContainsNoCase function

CF 2016+

writeOutput(arrayContainsNoCase(["first", "SECOND"], "First"));

Lucee 4+ CF 2021+

arrayWithStrings = ["first", "SECOND"];
writeOutput(arrayWithStrings.containsNoCase("FIrst"));

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub