Table of contents
Collapse the table of content
Expand the table of content

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

Den Delimarsky|Last Updated: 8/18/2017
1 Contributor

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


rows Type: seq<'T>

The sequence of sequences for the array rows.


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.


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

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


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

Core.ExtraTopLevelOperators Module (F#)

Microsoft.FSharp.Core Namespace (F#)

© 2020 Microsoft