Export (0) Print
Expand All
Expand Minimize

Array.concat<'T> Function (F#)

Builds a new array that contains the elements of each of the given sequence of arrays.

Namespace/Module Path: Microsoft.FSharp.Collections.Array

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

// Signature:
Array.concat : seq<'T []> -> 'T []

// Usage:
Array.concat arrays

arrays

Type: seq<'T []>

The input sequence of arrays.

The concatenation of the sequence of input arrays.

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

The following example demonstrates the use of Array.concat.

let multiplicationTable max = seq { for i in 1 .. max -> [| for j in 1 .. max -> (i, j, i*j) |] }
printfn "%A" (Array.concat (multiplicationTable 3))
[|(1, 1, 1); (1, 2, 2); (1, 3, 3); (2, 1, 2); (2, 2, 4); (2, 3, 6);
 (3, 1, 3); (3, 2, 6); (3, 3, 9)|]

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

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

Show:
© 2014 Microsoft