Category: Script
/ Arrays
Since engine version: 1.0 OC
GetIndexOf
Description
Finds the first occurrence of a value in an array and returns its zero-based index. If the element is not found, -1 is returned. The usual rules for comparison using the ==-operator apply.
Syntax
int GetIndexOf(array array2search, any needle);
Parameters
- array2search:
- Array in which the element should be searched. The array can be zero, in which case the element is never found and -1 is returned.
- needle:
- The value to which every element of the array is to be compared.