Metodo Set.IsSubsetOf<'T> (F#)

Restituisce true se tutti gli elementi del primo set sono presenti nel secondo.

Percorso di spazio dei nomi/modulo: Microsoft.FSharp.Collections

Assembly: FSharp.Core (in FSharp.Core.dll)

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

// Usage:
set.IsSubsetOf (otherSet)

Parametri

  • otherSet
    Tipo: Set<'T>

    Set di cui eseguire il test.

Valore restituito

true se questo set è un subset di otherSet.In caso contrario, restituisce false.

Esempio

Nel codice riportato di seguito viene illustrato l'utilizzo del metodo IsSubsetOf.

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

Output

  

Piattaforme

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Informazioni sulla versione

Versioni della libreria di base F#

Supportato in: 2,0, 4,0, portabile

Vedere anche

Riferimenti

Classe Collections.Set<'T> (F#)

Spazio dei nomi Microsoft.FSharp.Collections (F#)