yushff

code the world。

导航

2013年5月25日

摘要: 方法如下,使用正则表达式: stringabc="345555567611";stringstr=System.Text.RegularExpressions.Regex.Replace(abc,@"\s+",",");string[]aa=str.Split(',');也可以直接分割:string[]aa=System.Text.RegularExpressions.Regex.Split(abc,@"\s+");from: http://hi.baidu.com/zhenzhounew/item 阅读全文

posted @ 2013-05-25 20:44 yushff 阅读(1094) 评论(0) 推荐(0)

摘要: 需要引入命名空间 using System.Text.RegularExpressions;(若不引入,则写Regex时要写成 System.Text.RegularExpressions.Regex) 正则表达式的Replace方法string t = "sdf1234sdf12sd12";t = System.Text.RegularExpressions.Regex.Replace(t, @"\d+[a-zA-Z]+", "");@"\d+[a-z]+|[A-Z]+" 匹配的是 数字加字母; System.T 阅读全文

posted @ 2013-05-25 20:43 yushff 阅读(374) 评论(0) 推荐(0)