Search an array for a value
inArray( needle, const haystack[], size=sizeof(haystack) )
Search an array for a value
needle | Needle value to search for |
haystack | Haystack array |
size | Number of items in Haystack |
If the needle value is found, returns the index in the array (0-indexed).
If not found, returns -1.
new mynumbers[] = [8, 6, 7, 5, 3, 0, 9];
new x;
x = inArray(7, mynumbers);
// x = 2