indexOfLast

inline suspend fun <E> ReceiveChannel<E>.indexOfLast(
    predicate: (E) -> Boolean
): Int
(source)

Platform and version requirements: JVM

Returns index of the last element matching the given predicate, or -1 if the channel does not contain such element.

The operation is terminal. This function consumes all elements of the original ReceiveChannel.