Returns a new set with the elements that are common to both this set and the given sequence.
SDK
- Xcode 8.3+
Framework
- Swift Standard Library
Declaration
Parameters
other
A sequence of elements.
other
must be finite.
Return Value
A new set.
Discussion
In the following example, the both
set is made up of the elements that are in both the employees
and neighbors
sets. Elements that are in only one or the other are left out of the result of the intersection.