Udostępnij za pośrednictwem


Array.length<'T> — Funkcja (F#)

Zwraca długość tablicy.

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

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

// Signature:
Array.length : 'T [] -> int

// Usage:
Array.length array

Parametry

  • array
    Type: 'T[]

    Tablicy wejściowy.

Wartość zwracana

Długość tablicy.

Uwagi

Można również użyć właściwości Length.

Ta funkcja o nazwie Length 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 demonstruje, jak używać Array.length.

Array.length [| 1 .. 100 |] |> printfn "Length: %d"
Array.length [| |] |> printfn "Length: %d"
Array.length [| 1 .. 2 .. 100 |] |> printfn "Length: %d"

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

Collections.Array — Moduł (F#)

Microsoft.FSharp.Collections — Przestrzeń nazw (F#)