indexOf

fun <T> List<T>.indexOf(from: Int, predicate: (T) -> Boolean): Int

Finds the index of the first element that matches the given predicate starting from the specified from index.

Return

the index of the first matching element, or -1 if no elements match the condition.

Parameters

from

the index from which to start searching. Must be within the bounds of the list.

predicate

a lambda function to test each element for a condition.

Throws

if from is out of bounds.