System.Text.RegularExpressions.GroupCollection Class

Assembly: System.dll
Namespace: System.Text.RegularExpressions
Summary
Represents a collection of captured groups.GroupCollection returns the set of captured groups in a single match.
C# Syntax:
[Serializable]
public class GroupCollection : ICollection, IEnumerable
Remarks
The collection is immutable (read-only) and has no public constructor. Instances are returned in the collection returned by Match.Groups
See also:
System.Text.RegularExpressions Namespace

System.Text.RegularExpressions.GroupCollection Member List:

Public Properties
Count Read-only

Returns the number of groups in the collection.
IsReadOnly Read-only

Gets a value indicating whether the collection is read-only.
IsSynchronized Read-only

Gets a value indicating whether access to the GroupCollection is synchronized (thread-safe).
Item Read-only

Overloaded:
Item[int groupnum] {get

Enables access to a member of the collection by integer index.
Item Read-only

Overloaded:
Item[string groupname] {get

Enables access to a member of the collection by string index.
SyncRoot Read-only

Gets an object that can be used to synchronize access to the GroupCollection.
Public Methods
CopyTo Copies all the elements of the collection to the given array beginning at the given index.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetEnumerator Returns an enumerator that can iterate through the Collection.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Text.RegularExpressions.GroupCollection Member Details

Property: Count (read-only)
Summary
Returns the number of groups in the collection.
C# Syntax:
public int Count {get;}
Implements:
ICollection.Count
Remarks
Count can be zero or more.

Return to top


Property: IsReadOnly (read-only)
Summary
Gets a value indicating whether the collection is read-only.
C# Syntax:
public bool IsReadOnly {get;}
Remarks
GroupCollection.IsReadOnly is always true.

Return to top


Property: IsSynchronized (read-only)
Summary
Gets a value indicating whether access to the GroupCollection is synchronized (thread-safe).
C# Syntax:
public bool IsSynchronized {get;}
Implements:
ICollection.IsSynchronized
Remarks
GroupCollection.IsSynchronized is always false.

Return to top


Overloaded Property: Item (read-only)
Summary
Enables access to a member of the collection by integer index.
C# Syntax:
public Group this[int groupnum] {get;}
Parameters:

groupnum

Key of the collection member to be retrieved.

Return to top


Overloaded Property: Item (read-only)
Summary
Enables access to a member of the collection by string index.
C# Syntax:
public Group this[string groupname] {get;}
Parameters:

groupname

Key of the collection member to be retrieved.

Return to top


Property: SyncRoot (read-only)
Summary
Gets an object that can be used to synchronize access to the GroupCollection.
C# Syntax:
public object SyncRoot {get;}
Implements:
ICollection.SyncRoot

Return to top


Method: CopyTo(
   Array array,
   int arrayIndex
)
Summary
Copies all the elements of the collection to the given array beginning at the given index.
C# Syntax:
public void CopyTo(
   Array array,
   int arrayIndex
);
Parameters:

array

The array the collection is to be copied into.

arrayIndex

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

Implements:
ICollection.CopyTo
Remarks
Since 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.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~GroupCollection();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetEnumerator()
Summary
Returns an enumerator that can iterate through the Collection.
C# Syntax:
public IEnumerator GetEnumerator();
Return Value:
An IEnumerator object that contains all Group objects in the GroupCollection.
Implements:
IEnumerable.GetEnumerator

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.