次の方法で共有


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

Parameters

  • arrays
    Type: seq<'T[]>

    The input sequence of arrays.

Return Value

The concatenation of the sequence of input arrays.

Remarks

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.

Example

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)|]

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

Collections.Array Module (F#)

Microsoft.FSharp.Collections Namespace (F#)