indicesOf

inline fun <E> Collection<E>.indicesOf(predicate: (E) -> Boolean): List<Int>(source)

Finds the indices of all elements in the receiver collection that match the given predicate.

Receiver

The collection to be searched.

Return

A list containing the indices of all elements that match the predicate.

Parameters

predicate

A function that determines if an element's index should be included in the output list.