ArrayDeleteAt

Deletes an element from an array and resizes the array so that the deleted element doesn't leave a gap.

ArrayDeleteAt( array, position )

Returns: Boolean

Argument Description
array
array, required

The array that the element will be deleted from.

position
number, required

The numeric position of the element. Remember that CFML arrays start at 1 not 0.

Examples

Deletes an array element by its index

arr = [12,0,1,2,3,4,5,6];
dump(arr);
arrayDelete(arr,4);
dump(arr);

Deletes an array element by its index (member function)

arr = [12,0,1,2,3,4,5,6];
dump(arr);
arr.delete(4);
dump(arr);

See also