次の方法で共有


ExtraTopLevelOperators.array2D<'T> Function (F#)

Builds a 2D array from a sequence of sequences of elements.

Namespace/Module Path: Microsoft.FSharp.Core.ExtraTopLevelOperators

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

// Signature:
array2D : seq<#seq<'T>> -> 'T [,]

// Usage:
array2D rows

Parameters

  • rows
    Type: seq<'T>

    The sequence of sequences for the array rows.

Remarks

This function is named CreateArray2D in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.

Example

The following code shows how to initialize a two-dimensional array using array2D.

let myArray2D : string[,] = array2D [["a1"; "b1"; "c1"]; ["a2"; "b2"; "c2"]] 

Platforms

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

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Reference

Core.ExtraTopLevelOperators Module (F#)

Microsoft.FSharp.Core Namespace (F#)