Adrien
Adrien

Reputation: 489

Nim: find the index of an item in an array or sequence

Is there a builtin method to find the index of an item in an array or sequence, equivalent to Python index ? (It may return the index of the first occurrence, or all the indices.)

Upvotes: 5

Views: 4352

Answers (1)

flyx
flyx

Reputation: 39768

There's find.

Returns the first index of item in a or -1 if not found. This requires appropriate items and == operations to work.

Upvotes: 12

Related Questions