Instance Method インスタンスメソッド

isDisjoint(with:)

Returns a Boolean value that indicates whether the set has no members in common with the given set. この集合が、与えられた集合と共通のメンバを1つも持たないかどうかを指し示すブール値を返します。

Declaration 宣言

func isDisjoint(with other: CharacterSet) -> Bool

Parameters パラメータ

other

A set of the same type as the current set. 現在の集合と同じ型の集合。

Return Value 戻り値

true if the set has no elements in common with other; otherwise, false. この集合がotherと共通の要素を持たないならばtrue;そうでなければ、false

Discussion 議論

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"

See Also 参照

Combining Character Sets 文字集合を結合する