findIndex

fun findIndex(element: Int, array: IntArray): Int

If the array is empty, -1 is returned.

Return

the index of the first occurrence of the element

Parameters

element

the element to search for

array

the array to search in


fun findIndex(element: Double, array: DoubleArray): Int
fun findIndex(element: Long, array: LongArray): Int
fun findIndex(element: String, array: Array<String>): Int

If the array is empty or the element is not found, -1 is returned.

Return

the index of the first occurrence of the element

Parameters

element

the element to search for

array

the array to search in