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 or for complex objects such as structures. Simple object string searches are case-sensitive. This function does not support searches for COM and CORBA objects.

Returns

The updated array.

Category

Function syntax

ArrayDelete(array,value)

History

ColdFusion (2018 release): Made the following changes:

  • Introduced named parameters.
  • Returns the updated array.

See also

Parameters

Parameter

Description

array

Array to search in.

value

Value to search for.

Example

<cfscript>
       myArray=["London", "New York", "Paris", "Barcelona", "Berlin", "Tokyo", "Seattle"];
       WriteOutput("Input array is: ");
       writeDump(myArray)
       // Delete "Paris"
       ArrayDelete(myArray,"Paris"); // Returns True since Paris is a member of myArray
       WriteOutput("Array after deleting Paris is: ");
        writeDump(myArray)
</cfscript>

Output

ArrayDelete

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