System.Text.RegularExpressions.GroupCollection.GetEnumerator Method

Provides an enumerator that iterates through the collection.

Syntax

public IEnumerator GetEnumerator ()

Returns

An enumerator that contains all System.Text.RegularExpressions.Group objects in the System.Text.RegularExpressions.GroupCollection.

Remarks

Instead of calling the GroupCollection.GetEnumerator method to retrieve an enumerator that lets you iterate through the System.Text.RegularExpressions.Group objects in the collection, you should use the group iteration construct (such as foreach in C# and For Each…Next in Visual Basic) that is provided by your programming language.

Requirements

Namespace: System.Text.RegularExpressions
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0