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

Yes, on successful deletion of the array element.

Category

Function syntax

ArrayDelete(array,object)

See also

Parameters

Parameter

Description

array

Array to search in.

object

Object to search for.

Example

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

Output

Input array is: ["London","New York","Paris","Barcelona","Berlin","Tokyo","Seattle"]|Array after deleting Paris is: ["London","New York","Barcelona","Berlin","Tokyo","Seattle"]

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