设为首页 加入收藏

TOP

正则表达式简介与常用表达(三)
2015-02-02 14:23:32 来源: 作者: 【 】 浏览:23
Tags:正则 表达式 简介 常用 表达
.test.com";


s=Regex.Replace(s, @"(.+)", @"$1");


Console.WriteLine(s);


Console.ReadKey();


?


5)? ? ? ? 将文本中连续的空格替换为一个空格.


“hello? ? ? ? welcome? ? to China.”→”hello welcome to China”


string s = "hello? ? ? ? welcome? ? to China.";


s=Regex.Replace(s, @"(\s)+", @"$1");


Console.WriteLine(s);


Console.ReadKey();


?


6)? ? ? ? UBB翻译


string str = Regex.Replace(s, @".+=(.+)\](.+)\[.+", @"$2");


Console.WriteLine(str);


Console.ReadKey();


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇为什么会有extern “C”这样的规.. 下一篇GCC编译器入门

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: