Return Value 戻り値
true
if the set has no elements in common with other
; otherwise, false
.
この集合がother
と共通の要素を持たないならばtrue
;そうでなければ、false
。
Availability 有効性
Technology
func isDisjoint(with other: Self) -> Bool
true
if the set has no elements in common with other
; otherwise, false
.
この集合がother
と共通の要素を持たないならばtrue
;そうでなければ、false
。
other
A set of the same type as the current set. 現在の集合と同じ型の集合。
In the following example, the employees
set is disjoint with the visitors
set because no name appears in both sets.
次の例において、employees
集合はvisitors
集合と交わりを持ちません、両方に現れる名前がないからです。
let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let visitors: Set = ["Marcia", "Nathaniel", "Olivia"]
print(employees.isDisjoint(with: visitors))
// Prints "true"