JsonArray.ICollection<JsonNode>.CopyTo(JsonNode[], Int32) Method

Definition

Copies the entire Array to a compatible one-dimensional array, starting at the specified index of the target array.

C#
void ICollection<JsonNode>.CopyTo(System.Text.Json.Nodes.JsonNode?[]? array, int index);

Parameters

array
JsonNode[]

The one-dimensional Array that is the destination of the elements copied from JsonArray. The Array must have zero-based indexing.

index
Int32

The zero-based index in array at which copying begins.

Implements

Exceptions

array is null.

index is less than 0.

The number of elements in the source ICollection is greater than the available space from index to the end of the destination array.

Applies to

Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)