Group.Success 属性

定义

获取一个值,该值指示匹配是否成功。Gets a value indicating whether the match is successful.

public:
 property bool Success { bool get(); };
public bool Success { get; }
member this.Success : bool
Public ReadOnly Property Success As Boolean

属性值

Boolean

如果匹配成功,则为 true;否则为 falsetrue if the match is successful; otherwise, false.

注解

Success如果此组至少捕获了一个子字符串,则属性为 true。The Success property is true if at least one substring was captured by this group. 它等效于 > 0) (的布尔表达式。It is equivalent to the Boolean expression (Group.Captures.Count > 0).

适用于