Funzione di tipo Array.empty<'T> (F#)

Restituisce una matrice vuota del tipo specificato.

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

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

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

// Usage:
Array.empty

Valore restituito

Matrice vuota.

Note

Questa funzione è denominata Empty negli assembly compilati.Utilizzare questo nome se si accede alla funzione da un linguaggio .NET diverso da F# o tramite reflection.

Esempio

Nel codice riportato di seguito viene illustrato come utilizzare 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

Output

  

Piattaforme

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

Informazioni sulla versione

Versioni della libreria di base F#

Supportato in: 2,0, 4,0, portabile

Vedere anche

Riferimenti

Modulo Collections.Array (F#)

Spazio dei nomi Microsoft.FSharp.Collections (F#)