User Guide Cancel

ArrayContainsNoCase

 

Note:

As of ColdFusion (2021 release), CORBA has been removed. You can no longer use CORBA-related features, functions, and tags.

Description

This function searches an array for the presence of a specified object. The function searches for simple objects such as strings and numbers or for complex objects such as structures. Simple object string searches are case-insensitive. This function does not support searches for COM and CORBA objects.

Returns

Yes, if the specified object exists in the array.

Category

Array functions

History

  • Adobe ColdFusion (2018 release): Introduced named parameters.
  • Adobe ColdFusion (2016 release): Added the function

Syntax

ArrayContainsNoCase(array, value)

See also

ArrayContains, ArrayFind, ArrayFindNoCase

Parameters

Parameter

Description

array

Name of the array.

value Object to search for.

Example

<cfscript>
myArray=["Boat","Car"];
WriteOutput(ArrayContainsNoCase(myArray,"boat") & " | "); //returns YES since "Boat" is a member of myArray
WriteOutput(ArrayContainsNoCase(myArray,"train")); //returns NO since "Train" is not a member of myArray
</cfscript>
<cfscript> myArray=["Boat","Car"]; WriteOutput(ArrayContainsNoCase(myArray,"boat") & " | "); //returns YES since "Boat" is a member of myArray WriteOutput(ArrayContainsNoCase(myArray,"train")); //returns NO since "Train" is not a member of myArray </cfscript>
<cfscript>
   myArray=["Boat","Car"];
   WriteOutput(ArrayContainsNoCase(myArray,"boat") & " | "); //returns YES since "Boat" is a member of myArray
   WriteOutput(ArrayContainsNoCase(myArray,"train")); //returns NO since "Train" is not a member of myArray
</cfscript>

Output

YES | NO

Get help faster and easier

New user?