Share via


CopyTo Method (Array)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable Sub CopyTo ( _
    array As Array _
)
public virtual void CopyTo(
    Array array
)
public:
virtual void CopyTo(
    Array^ array
)
abstract CopyTo : 
        array:Array -> unit 
override CopyTo : 
        array:Array -> unit 
public function CopyTo(
    array : Array
)

Parameters

Remarks

The specified array must be of a compatible type.

This method uses Array..::..Copy to copy the elements.

The elements are copied to the Array in the same order in which the enumerator iterates through the ArrayList.

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

.NET Framework Security

See Also

Reference

ArrayList Class

CopyTo Overload

System.Collections Namespace