RegexCollection.CopyTo(Regex[], Int32) Method

Definition

Copies the entire RegexCollection to a compatible one-dimensional array, starting at the specified index of the target array.

public:
 void CopyTo(cli::array <System::Text::RegularExpressions::Regex ^> ^ array, int index);
public void CopyTo (System.Text.RegularExpressions.Regex[] array, int index);
abstract member CopyTo : System.Text.RegularExpressions.Regex[] * int -> unit
Public Sub CopyTo (array As Regex(), index As Integer)

Parameters

array
Regex[]

The one-dimensional array that is the destination of the elements copied from RegexCollection. The array must have zero-based indexing.

index
Int32

The zero-based index in array at which copying begins.

Exceptions

array is a null reference.

index is less than zero.

array is multidimensional.-or-The number of elements in the source RegexCollection is greater than the available space from index to the end of the destination array.

The type of the source RegexCollection cannot be cast automatically to the type of the destination array.

Applies to