c#正则

参考自:http://www.cnblogs.com/luckjun/archive/2011/06/05/2072979.html

有的时候,
string str;
str.replace;//不管用,这个时候用正则替换就比较保险啦。

asp.net--C#字符串只执行一次替换的示例代码
string s = "aaa";
Regex r = new Regex("a");
s=r.Replace(s,"b",1);
Response.Write(s);//输出baa

posted on 2014-04-08 09:48  鸣动我心  阅读(139)  评论(0编辑  收藏  举报