Copies the entire
CollectionT to a compatible one-dimensional
Array, starting at the specified index of the target array.
Namespace: System.Collections.ObjectModelAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public void CopyTo(
T[] array,
int index
)
Parameters
- array
- Type: T
The one-dimensional Array that is the destination of the elements copied from CollectionT. The Array must have zero-based indexing. - index
- Type: SystemInt32
The zero-based index in array at which copying begins.
Implements
ICollectionTCopyTo(T, Int32)Exceptions Exception | Condition |
---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | index is less than zero. |
ArgumentException | The number of elements in the source CollectionT is greater than the available space from index to the end of the destination array. |
See Also