static string CapText(Match m)
{
// Get the matched string.
string x = m.ToString();
// double this value
string result = (int.Parse(x) * 2).ToString();
return result;
}
static string striphtml2(string strhtml)
{
strhtml = "i have 200% dollars300%";
CaptureCollection c = Regex.Match(strhtml, @"/d+").Captures;
string s = null;
foreach(Match m in c)
{
s = m.ToString();
}
string result = Regex.Replace(strhtml, @"/d+",new MatchEvaluator(CapText));
return result;
}
matchevaluator
最新推荐文章于 2022-02-17 17:00:36 发布