This documentation is archived and is not being maintained.

MatchCollection::ICollection::CopyTo Method

Updated: June 2011

Copies all the elements of the collection to the specified array starting at the specified index.

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

private:
virtual void CopyTo(
	Array^ array, 
	int arrayIndex
) sealed = ICollection::CopyTo

Parameters

array
Type: System::Array
The one-dimensional array the collection is to be copied into.
arrayIndex
Type: System::Int32
The zero-based index in the array where copying is to begin.

Implements

ICollection::CopyTo(Array, Int32)

ExceptionCondition
ArgumentException

array is a multi-dimensional array.

IndexOutOfRangeException

arrayIndex is outside the bounds of array.

-or-

arrayIndex plus MatchCollection::Count is outside the bounds of array.

This member is an explicit interface implementation. It can be used only when the MatchCollection instance is cast to an ICollection interface object.

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

Portable Class Library

Supported in: Portable Class Library

Date

History

Reason

June 2011

Documented Portable Class Library member.

Information enhancement.

Show: