Product SiteDocumentation Site

5.3.6.30. remove


           +-,-----+
           V       |
>>-remove(---index-+-)-----------------------------------------><

Returns and removes the member item with the specified index or indexes from the array. If there is no item with the specified index or indexes, the Nil object is returned and no item is removed. The index of the removed item becomes unused and the hasIndex method for the given index will now return false. The size of the array is unchanged and no other indexes of the array are modified with the removal.
Note that the index argument may also be specified as an array of indexes.

Example 5.154. Array class - remove method

a = .array~of("Fred", "Mike", "Mike", "David")
a~remove(2)  -- removes "Mike"