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 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2.
Informazioni sulla versione
F# Runtime
Supportato in: 2.0, 4.0
Silverlight
Supportato in: 3
Vedere anche
Riferimenti
Classe Collections.Set<'T> (F#)
Spazio dei nomi Microsoft.FSharp.Collections (F#)
Cronologia delle modifiche
Data |
Cronologia |
Motivo |
---|---|---|
Maggio 2010 |
Aggiunto esempio di codice. |
Miglioramento delle informazioni. |