Table of Contents

Method CopyTo

Namespace
Zyl.ExSpans
Assembly
ExSpans.Core.dll

CopyTo<T>(T[]?, ExSpan<T>)

Copies the contents of the array into the span. If the source and destinations overlap, this method behaves as if the original values in a temporary location before the destination is overwritten. (将数组的内容复制到跨度中. 如果源和目标重叠, 则此方法的行为就像覆盖目标之前临时位置中的原始值一样).

public static void CopyTo<T>(this T[]? source, ExSpan<T> destination)

Parameters

source T[]

The array to copy items from (要从中复制项的数组).

destination ExSpan<T>

The span to copy items into (要将项复制到的跨度).

Type Parameters

T

The element type (元素的类型).

Exceptions

ArgumentException

Thrown when the destination Span is shorter than the source array.