CaptureCollection.CopyTo Method (Array, Int32)


Copies all the elements of the collection to the given array beginning at the given index.

Namespace:   System.Text.RegularExpressions
Assembly:  System (in System.dll)

public void CopyTo(
	Array array,
	int arrayIndex


Type: System.Array

The array the collection is to be copied into.

Type: System.Int32

The position in the destination array where copying is to begin.

Exception Condition

array is null.


arrayIndex is outside the bounds of array.


arrayIndex plus CaptureCollection.Count is outside the bounds of array.

Because the entire collection is copied into the array starting at the given index, the destination array must be at least as large as the collection.


This member is not present in the Portable Class Library. If you are developing applications that target the Portable Class Library, use the CaptureCollection.ICollection.CopyTo method instead.

.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft