Skip to main content
Version: v0.17.0

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.

ParameterTypeRequiredPositionSummary
Array
In
array<T>1The array to check.
Element
Item
T2The 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