func subtracting(Self) -> Self
Returns a new set containing the elements of this set that do not occur in the given set.
与えられた集合の中の現れないこの集合の要素を含んでいる新しい集合を返します。
Availability
Technology
func subtracting(_ other: Self) -> Self
other
A set of the same type as the current set. 現在の集合と同じ型の集合。
A new set. 新しい集合。
In the following example, the non
set is made up of the elements of the employees
set that are not elements of neighbors
:
次の例において、non
集合はemployees
集合の要素でneighbors
の要素でないものから作り上げられます:
let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"]
let nonNeighbors = employees.subtracting(neighbors)
print(nonNeighbors)
// Prints "["Diana", "Chris", "Alicia"]"
func subtracting(Self) -> Self