ArrayList.ToArray Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Copies the elements of the ArrayList to a new Object array.

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

public virtual object[] ToArray()

Return Value

Type: System.Object[]

An Object array containing copies of the elements of the ArrayList.

The elements are copied using Array.Copy, which is an O(n) operation, where n is Count.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show: