语言

MatchEvaluator 委托

定义

表示每次在方法操作过程中 Replace(String, MatchEvaluator) 找到正则表达式匹配时调用的方法。

public delegate System::String ^ MatchEvaluator(Match ^ match);
public delegate string MatchEvaluator(Match match);
[System.Serializable]
public delegate string MatchEvaluator(Match match);
type MatchEvaluator = delegate of Match -> string
[<System.Serializable>]
type MatchEvaluator = delegate of Match -> string
Public Delegate Function MatchEvaluator(match As Match) As String 

参数

match
Match

表示 Match 方法操作期间 Replace(String, MatchEvaluator) 单个正则表达式匹配的对象。

返回值

由委托表示的方法返回的 MatchEvaluator 字符串。

属性

注解

可以使用 MatchEvaluator 委托方法对替换方法找到的每个匹配项执行自定义验证或操作操作,例如 Replace(String, MatchEvaluator)。 对于每个匹配字符串,该方法 Replace(String, MatchEvaluator) 使用表示匹配的对象调用 MatchEvaluator 委托方法 Match 。 委托方法执行你喜欢的任何处理,并返回该方法替换匹配字符串的字符串 Replace(String, MatchEvaluator) 。

扩展方法

名称 说明
GetMethodInfo(Delegate)

获取一个对象,该对象表示由指定委托表示的方法。

适用于

另请参阅