findIndex

fun <T> Iterable<T>.findIndex(predicate: (T) -> Boolean): Int

Returns the index from any elements that appears true from the predicate closure, otherwise, it returns false.

Return

The remaining index that the predicate closure returned true. Otherwise, it'll return -1 if the remaining elements didn't match the predicate closure.

Parameters

predicate

The predicate closure to call