Returns a Boolean value that indicates whether the given element exists in the set.
SDK
- Xcode 6.3+
Framework
- Swift Standard Library
Declaration
Parameters
member
An element to look for in the set.
Return Value
true
if member
exists in the set; otherwise, false
.
Discussion
This example uses the contains(_:)
method to test whether an integer is a member of a set of prime numbers.
Complexity: O(1)