Bewerken

Share via


SortedSet<T>.CopyTo Method

Definition

Copies a portion or all of a SortedSet<T> to a compatible one-dimensional array, starting at the beginning of the destination array or at a specified index.

Overloads

CopyTo(T[], Int32, Int32)

Copies a specified number of elements from SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

CopyTo(T[], Int32)

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

CopyTo(T[])

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the beginning of the target array.

Remarks

This method is an O(n) operation, where n is Count.

CopyTo(T[], Int32, Int32)

Source:
SortedSet.cs
Source:
SortedSet.cs
Source:
SortedSet.cs

Copies a specified number of elements from SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

public:
 void CopyTo(cli::array <T> ^ array, int index, int count);
public void CopyTo (T[] array, int index, int count);
member this.CopyTo : 'T[] * int * int -> unit
Public Sub CopyTo (array As T(), index As Integer, count As Integer)

Parameters

array
T[]

A one-dimensional array that is the destination of the elements copied from the SortedSet<T>. The array must have zero-based indexing.

index
Int32

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

count
Int32

The number of elements to copy.

Exceptions

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

array is null.

index is less than zero.

-or-

count is less than zero.

Remarks

This method is an O(n) operation, where n is count.

Applies to

CopyTo(T[], Int32)

Source:
SortedSet.cs
Source:
SortedSet.cs
Source:
SortedSet.cs

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

public:
 virtual void CopyTo(cli::array <T> ^ array, int index);
public void CopyTo (T[] array, int index);
abstract member CopyTo : 'T[] * int -> unit
override this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), index As Integer)

Parameters

array
T[]

A one-dimensional array that is the destination of the elements copied from the SortedSet<T>. The array must have zero-based indexing.

index
Int32

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

Implements

Exceptions

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

array is null.

index is less than zero.

Remarks

This method is an O(n) operation, where n is Count.

Applies to

CopyTo(T[])

Source:
SortedSet.cs
Source:
SortedSet.cs
Source:
SortedSet.cs

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the beginning of the target array.

public:
 void CopyTo(cli::array <T> ^ array);
public void CopyTo (T[] array);
member this.CopyTo : 'T[] -> unit
Public Sub CopyTo (array As T())

Parameters

array
T[]

A one-dimensional array that is the destination of the elements copied from the SortedSet<T>.

Exceptions

The number of elements in the source SortedSet<T> exceeds the number of elements that the destination array can contain.

array is null.

Remarks

The indexing of array must be zero-based.

Applies to