Array.blit<'T> 函数 (F#)

从第一个数组中读取一定范围的元素,并将这些元素写入第二个数组。

命名空间/模块路径: Microsoft.FSharp.Collections.Array

程序集:FSharp.Core(在 FSharp.Core.dll 中)

// Signature:
Array.blit : 'T [] -> int -> 'T [] -> int -> int -> unit

// Usage:
Array.blit source sourceIndex target targetIndex count

参数

  • source
    类型:'T []

    源数组。

  • sourceIndex
    类型:int

    源数组的起始索引。

  • target
    类型:'T []

    目标数组。

  • targetIndex
    类型:int

    目标数组的起始索引。

  • count
    类型:int

    要复制的元素数。

备注

此函数在编译的程序集中名为 CopyTo。 如果从 F# 以外的语言中访问函数,或通过反射访问成员,请使用此名称。

示例

下面的代码示例演示 Array.blit 的用法。

let array1 = [| 1 .. 10 |]
let array2 = Array.zeroCreate 20
// Copy 4 elements from index 3 of array1 to index 5 of array2.
Array.blit array1 3 array2 5 4
printfn "%A" array2

Output

  

平台

Windows 8,Windows 7,Windows server 2012中,Windows server 2008 R2

版本信息

F#核心库版本

支持:2.0,4.0,可移植

请参见

参考

Collections.Array 模块 (F#)

Microsoft.FSharp.Collections 命名空间 (F#)