removeIf

fun removeIf(filter: Predicate<in T>): Boolean

Removes all elements of this collection that satisfy the given predicate.

Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.

Return

true if elements were removed.

Parameters

filter

A predicate which returns true for elements to be removed.

Throws

If the specified filter is null