我有一段代码长这个样子:
我需要像这样传递第二个参数:
text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff));
我需要像这样传递第二个参数:
text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff, otherData));
这是否可能,以及最好的方法是什么?
text = Regex.Replace(text, @"some_pattern", new MatchEvaluator(match => MatchEvalStuff(match, otherData)));
。 - Ryan Pergent