indexOfFirstOrNull

fun <T> Collection<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int?

Returns index of the first element matching the given predicate, or null if the collection does not contain such element.


fun <T> ArrayList<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int?

Returns index of the first element matching the given predicate, or null if the array does not contain such element.


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

Returns index of the first element matching the given predicate, or null if the iterable does not contain such element.