Condividi tramite


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

Restituisce true se tutti gli elementi del primo set sono presenti nel secondo e almeno un elemento del secondo non è presente nel primo.

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

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

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

// Usage:
set.IsProperSubsetOf (otherSet)

Parametri

  • otherSet
    Tipo: Set<'T>

    Set di cui eseguire il test.

Valore restituito

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

Esempio

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

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 proper subset of %A: %b" set2 set1 (set2.IsProperSubsetOf set1)
printfn "%A is a proper subset of %A: %b" set3 set1 (set3.IsProperSubsetOf set1) 
printfn "%A is a proper subset of %A: %b" set4 set1 (set4.IsProperSubsetOf 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.