any

inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean(source)

Returns true when at least one element matches predicate.

Stops at the first true predicate result. Returns false for an empty iterable without invoking the predicate. Exceptions from iteration or the callback propagate to the caller. The inline callback supports non-local returns.

Receiver

elements to visit in their iteration order.

Return

true if any element matches, or false otherwise.

Parameters

predicate

test receiving each visited element.