contains

operator fun <K, V> Map<K, V>.contains(key: K): Boolean(source)

Checks key membership using key in map syntax.

A key associated with null still belongs to the map. Delegates to Map.containsKey.

Receiver

map to inspect.

Return

true if an association exists for the key.

Parameters

key

key to search for.


operator fun <T> Iterable<T>.contains(element: T): Boolean(source)

Checks whether this iterable has an element equal to element.

Compares using element == value and stops at the first match. Null is a valid search value when the element type is nullable. Exceptions from iteration propagate to the caller.

Receiver

elements to visit in their iteration order.

Return

true on a match, or false when empty or unmatched.

Parameters

element

value to search for.