ArrayCopy Method (Array, Array, Int32) |
Copies a range of elements from an
Array starting at the first element and pastes them into another
Array starting at the first element. The length is specified as a 32-bit integer.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static void Copy(
Array sourceArray,
Array destinationArray,
int length
)
Parameters
- sourceArray
- Type: SystemArray
The Array that contains the data to copy. - destinationArray
- Type: SystemArray
The Array that receives the data. - length
- Type: SystemInt32
A 32-bit integer that represents the number of elements to copy.
Exceptions Exception | Condition |
---|
ArgumentNullException | sourceArray is null.-or-destinationArray is null. |
RankException | sourceArray and destinationArray have different ranks. |
ArrayTypeMismatchException | sourceArray and destinationArray are of incompatible types. |
InvalidCastException | At least one element in sourceArray cannot be cast to the type of destinationArray. |
ArgumentOutOfRangeException | length is less than zero. |
ArgumentException | length is greater than the number of elements in sourceArray.-or-length is greater than the number of elements in destinationArray. |
See Also