Description

Searches an array for the first position of a specified object and deletes it. The function searches for simple objects such as strings and numbers. Simple object string searches are case-insensitive. This function does not support searches for COM and CORBA objects.

Returns

Yes, on successful deletion of the array element.

Category

History

Added in Adobe ColdFusion (2016 release).

Function syntax

ArrayDeleteNoCase(array,object)

See also

Parameters

Parameter

Description

array

(Required) Array to search in.

object

(Required) A string, numeric, or boolean value on which to search. Case insensitive. If the object does not match any member in the array, the function returns false.

Example

<cfscript>
       myArray=ArrayNew(1);
       myArray=["Analyze","Analyse","Analysis","analyse","analysis","analyze"];
       WriteOutput(ArrayDeleteNoCase(myArray,"analyze")); // Returns true because object matches an element in the array
       WriteOutput(SerializeJSON(myArray)); // Returns array after deleting the first element in the array
</cfscript>

Output

["Analyse","Analysis","analyse","analysis","analyze"]

Using member function

<cfscript>
       myArray=ArrayNew(1);
       myArray=["Analyze","Analyse","Analysis","analyse","analysis","analyze"];
       WriteOutput(myArray.DeleteNoCase("analyze"));
       WriteOutput(SerializeJSON(myArray));
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy