GroupCollection.TryGetValue(String, Group) GroupCollection.TryGetValue(String, Group) GroupCollection.TryGetValue(String, Group) GroupCollection.TryGetValue(String, Group) Method

定义

尝试检索由提供的名称键标识的组(如果它存在于组集合中)。Attempts to retrieve a group identified by the provided name key, if it exists in the group collection.

public:
 virtual bool TryGetValue(System::String ^ key, [Runtime::InteropServices::Out] System::Text::RegularExpressions::Group ^ % value);
public bool TryGetValue (string key, out System.Text.RegularExpressions.Group value);
abstract member TryGetValue : string * Group -> bool
override this.TryGetValue : string * Group -> bool
Public Function TryGetValue (key As String, ByRef value As Group) As Boolean

参数

key
String String String String

一个字符串,其中包含要查找的组名称键。A string with the group name key to look for.

value
Group Group Group Group

当方法返回时,如果找到名称为 key 的组,则返回该组;否则,如果未找到,则返回 nullWhen the method returns, the group whose name is key, if it is found; otherwise, null if not found.

返回

如果由提供的名称键标识的组存在,则为 true;否则为 falsetrue if a group identified by the provided name key exists; false otherwise.

适用于