contains(_:)

Returns a Boolean value indicating whether the collection contains the given sequence.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
func contains<C>(_ other: C) -> Bool where C : Collection, Self.Element == C.Element

Parameters

other

A sequence to search for within this collection.

Returns

true if the collection contains the specified sequence, otherwise false.