contains

context(_: Equality<Element>)
operator fun <Element> KoneIterable<Element>.contains(element: Element): Boolean(source)

Checks if there is an element equal (in terms of the provided Equality) to the provided element.

The function goes through the whole iterable and stops iff there is no next element (when false is returned) or it found an equal element (when true is returned).

Receiver

The Equality context used to compare elements.

Return

true if the iterable contains the element, false otherwise.

Parameters

element

The element to search for.

Type Parameters

Element

The type of elements.