Udostępnij za pośrednictwem


Set.isProperSubset <'T> Funkcja (F#)

Wynikiem jest true są wszystkie elementy pierwszy zestaw w drugim i co najmniej jeden element drugi nie jest pierwszym.

Ścieżka obszaru nazw/modułu: Microsoft.FSharp.Collections.Set

Zestaw: FSharp.Core (w FSharp.Core.dll)

// Signature:
Set.isProperSubset : Set<'T> -> Set<'T> -> bool (requires comparison)

// Usage:
Set.isProperSubset set1 set2

Parametry

  • set1
    Typ: Ustaw<'T>

    Potencjalne podzbiór.

  • set2
    Typ: Ustaw<'T>

    Zestaw porównywane.

Wartość zwracana

trueJeśli set1 jest podzbiorem właściwego set2.W przeciwnym razie zwraca false.

Uwagi

Ta funkcja o nazwie IsProperSubset w skompilowane zestawy.Jeżeli języka, niż F# lub przez odbicie, uzyskują dostęp do funkcji, należy użyć tej nazwy.

Przykład

Poniższy kod ilustruje użycie Set.isProperSubset funkcji.

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

Dane wyjściowe

  

Platformy

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

Informacje o wersji

F# Core wersji biblioteki

Obsługiwane: 2.0, 4.0, przenośne

Zobacz też

Informacje

Moduł Collections.Set (F#)

Obszar nazw Microsoft.FSharp.Collections (F#)