Udostępnij za pośrednictwem


Array.empty<'T> — Typ funkcji (F#)

Zwraca pustą tablicę danego typu.

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

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

// Signature:
Array.empty<'T> :  'T []

// Usage:
Array.empty

Wartość zwracana

Pusta tablica.

Uwagi

Ta funkcja o nazwie Empty w skompilowane zestawy.Jeśli funkcja dostęp z języka .net niż F# lub przez odbicie, należy użyć tej nazwy.

Przykład

Poniższy kod pokazuje, jak używać Array.empty.

// Specify the type by using a type argument. 
let array1 = Array.empty<int>
// Specify the type by using a type annotation. 
let array2 : int array = Array.empty

// Even though array3 has a generic type, 
// you can still use methods such as Length on it. 
let array3 = Array.empty
printfn "Length of empty array: %d" array3.Length

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#)