读书人

*请问一个关于Regex.Replace的有关问题

发布时间: 2012-01-13 22:43:29 作者: rapoo

*************************请教一个关于Regex.Replace的问题*******************
我是这样做的
string str = ".........theForm.Submit();......... ";
string sTemp = Regex.Replace(str , "theForm.Submit(); ", "theForm.Submit();fun1(); ",RegexOption.IgnoreCase);

用上面的代码把把theForm.Submit();替换成theForm.Submit();fun1();
但是程序执行后没有替换,是什么地方没对吗?

[解决办法]
string sTemp = Regex.Replace(str, "theForm\\.Submit\\(\\); ", "theForm.Submit();fun1(); ", RegexOptions.IgnoreCase | RegexOptions.Multiline);

读书人网 >asp.net

热点推荐