CopyTo Method

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

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

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

Syntax

'Declaration
Public Sub CopyTo ( _
    array As Array, _
    arrayIndex As Integer _
)
public void CopyTo(
    Array array,
    int arrayIndex
)
public:
virtual void CopyTo(
    Array^ array, 
    int arrayIndex
) sealed
abstract CopyTo : 
        array:Array * 
        arrayIndex:int -> unit 
override CopyTo : 
        array:Array * 
        arrayIndex:int -> unit 
public final function CopyTo(
    array : Array, 
    arrayIndex : int
)

Parameters

Implements

ICollection. . :: . .CopyTo(Array, Int32)

Remarks

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

Because the MatchCollection object is generally populated by using lazy evaluation, trying to copy the collection before it has been fully populated may throw a RegexMatchTimeoutException exception. This exception can be thrown if a time-out value for matching operations is in effect, and the attempt to find a single match exceeds that time-out interval.

.NET Framework Security

See Also

Reference

MatchCollection Class

System.Text.RegularExpressions Namespace