ArrayFind
Alias:ArrayFind
, FindElement
, Find
Output:Int32
Gets the first index of an element in an array. The index starts at 0. Returns -1 if the element is not present.
Parameter | Type | Required | Position | Summary |
---|---|---|---|---|
Array In | array<T> | ✔ | 1 | The array to check. |
Element Item | T | ✔ | 2 | The element to look for. |
Examples​
Example 1​
SCL​
ArrayFind Array: [1, 2, 3] Element: 2
Expected Output​
1
Example 2​
SCL​
Find In: ['a', 'b', 'c'] Item: 'a'
Expected Output​
0
Example 3​
SCL​
Find In: ['a', 'b', 'c'] Item: 'd'
Expected Output​
-1