System.Text.RegularExpressions.CaptureCollection Class

Assembly: System.dll
Namespace: System.Text.RegularExpressions
Summary
Represents a sequence of capture substrings.CaptureCollection returns the set of captures done by a single capturing group.
C# Syntax:
[Serializable]
public class CaptureCollection : ICollection, IEnumerable
Remarks
The collection is immutable (read-only) and has no public constructor. Instances are returned in the Group.Captures collection.
See also:
System.Text.RegularExpressions Namespace

System.Text.RegularExpressions.CaptureCollection Member List:

Public Properties
Count Read-only

Gets the number of substrings captured by the group.
IsReadOnly Read-only

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

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

Gets an individual member of the collection.
SyncRoot Read-only

Gets an object that can be used to synchronize access to the collection.
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 Provides an enumerator in the same order as Item[i].
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.CaptureCollection Member Details

Property: Count (read-only)
Summary
Gets the number of substrings captured by the group.
C# Syntax:
public int Count {get;}
Implements:
ICollection.Count

Return to top


Property: IsReadOnly (read-only)
Summary
Gets a value that indicates whether the collection is read only.
C# Syntax:
public bool IsReadOnly {get;}

Return to top


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

Return to top


Property: Item (read-only)
Summary
Gets an individual member of the collection.
C# Syntax:
public Capture this[int i] {get;}
Parameters:

i

Index into the capture collection.

Exceptions
Exception Type Condition
ArgumentOutOfRangeException i is less than 0 or greater than CaptureCollection.Count.

Return to top


Property: SyncRoot (read-only)
Summary
Gets an object that can be used to synchronize access to the collection.
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 copying is to begin.

Implements:
ICollection.CopyTo
Remarks
Because 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:
~CaptureCollection();

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

Return to top


Method: GetEnumerator()
Summary
Provides an enumerator in the same order as Item[i].
C# Syntax:
public IEnumerator GetEnumerator();
Return Value:
A IEnumerator object that contains all Capture objects within the CaptureCollection.
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.