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

isSuperset(of:)

Returns a Boolean value that indicates whether the set is a superset of the given set. この集合が、与えられた集合の上位集合であるかどうかを指し示すブール値を返します。

Declaration 宣言

func isSuperset(of other: AttributedString.InterpolationOptions) -> Bool

Parameters パラメータ

other

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

Return Value 戻り値

true if the set is a superset of other; otherwise, false. この集合がotherの上位集合であるならばtrue;そうでなければ、false

Discussion 議論

Set A is a superset of another set B if every member of B is also a member of A. 集合Aがもう1つの集合Bの狭義の上位集合であるのは、BのすべてのメンバがまたAのメンバである場合です。


let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let attendees: Set = ["Alicia", "Bethany", "Diana"]
print(employees.isSuperset(of: attendees))
// Prints "true"