Product Site

5.3.6.9. delete

Returns and deletes the member item with the specified index from the array. If there is no item with the specified index, .nil is returned and no item is deleted. All elements following the deleted item will be moved left in the array ordering and the item indexes will be adjusted for the deletion. The size of the array will be reduced by one element.

The delete method is only valid with single-dimensional Arrays. The index argument may also be specified as an array of a single index.
Example 5.169. Array class — delete method
   a = .array~of("Fred", "Mike", "Rick", "David")
   a~delete(2)  -- removes "Mike", resulting in the array
                -- ("Fred", "Rick", "David")