Array.empty<'T> Type 関数 (F#)

指定した型の空の配列を返します。

名前空間/モジュール パス: Microsoft.FSharp.Collections.Array

アセンブリ: FSharp.Core (FSharp.Core.dll 内)

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

// Usage:
Array.empty

戻り値

空の配列。

解説

この関数は、コンパイルされたアセンブリでは Empty という名前です。F# 以外の .NET 言語から、またはリフレクションを使用してこの関数にアクセスする場合は、この名前を使用します。

使用例

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

出力

  

プラットフォーム

Windows 8、Windows 7、Windows Server 2012 で Windows Server 2008 R2

バージョン情報

F# コア ライブラリのバージョン

サポート: ポータブル 2.0、4.0

参照

関連項目

Collections.Array モジュール (F#)

Microsoft.FSharp.Collections 名前空間 (F#)