Return Value 戻り値
A new set. 新しい集合。
Availability 有効性
Technology
func subtracting(_ other: Self) -> Self
A new set. 新しい集合。
other
A set of the same type as the current 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"]"