GroupCollection.TryGetValue(String, Group) Method

Definition

Attempts to retrieve a group identified by the provided name key, if it exists in the group collection.

C#
public bool TryGetValue(string key, out System.Text.RegularExpressions.Group? value);
C#
public bool TryGetValue(string key, out System.Text.RegularExpressions.Group value);

Parameters

key
String

A string with the group name key to look for.

value
Group

When the method returns, the group whose name is key, if it is found; otherwise, null if not found.

Returns

true if a group identified by the provided name key exists; false otherwise.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10