Read Me - Common Public License V1.0 - Copyright Notice(©)

index


>>-index(item)-------------------------------------------------><

Returns the index of the specified item within the array. If the target item appears at more than one index, the first located index will be returned. For multi-dimension arrays, the index is returned as an array of index values. If the array does not contain the specified item, the Nil object is returned. Item equality is determined by using the == method of [item] .

Array class - index method

a = .array~of("Mike", "Rick", "Fred", "Rick")
say a~index("Rick")  -- says: 2

Read Me - Common Public License V1.0 - Copyright Notice(©)