Share via


Set.IsSupersetOf<'T> 方法 (F#)

更新:2010 年 5 月

評估為 true第一個的第二個集合的所有項目是否

命名空間/模組路徑: Microsoft.FSharp.Collections

組件:FSharp.Core (在 FSharp.Core.dll 中)

// Signature:
member this.IsSupersetOf : Set<'T> -> bool (requires comparison)

// Usage:
set.IsSupersetOf (otherSet)

參數

  • otherSet
    型別:Set<'T>

    做為測試依據的集合。

傳回值

true如果此設定的超集otherSet.

範例

下列程式碼會說明如何使用 IsSupersetOf方法。

let set1 = Set.ofList [ 1 .. 6 ]
let set2 = Set.ofList [ 1 .. 9 ]
let set3 = Set.ofList [ 1 .. 6 ]
let set4 = Set.ofList [ 5 .. 10 ]
printfn "%A is a superset of %A: %b" set2 set1 (set2.IsSupersetOf set1)
printfn "%A is a superset of %A: %b" set3 set1 (set3.IsSupersetOf set1) 
printfn "%A is a superset of %A: %b" set4 set1 (set4.IsSupersetOf set1) 

輸出

  

平台

Windows 7、Windows Vista SP2、Windows XP SP3、Windows XP x64 SP2、Windows Server 2008 R2、Windows Server 2008 SP2、Windows Server 2003 SP2

版本資訊

F# 執行階段

支援版本:2.0、4.0

Silverlight

支援版本:3

請參閱

參考

Collections.Set<'T> 類別 (F#)

Microsoft.FSharp.Collections 命名空間 (F#)

變更記錄

日期

History

原因

2010 年 5 月

加入程式碼範例。

資訊加強。