日期:2014-05-18 浏览次数:21045 次
string source = "123456789111222333"; Regex reg = new Regex(@"\d{3}"); MatchCollection mc = reg.Matches(source); foreach (Match m in mc) { MessageBox.Show(m.Value);//这就是拆分的集合 }
------解决方案--------------------
string a1="123456789111222333"; string[] result = Regex.Split(a1,@"(?<=\G\w{3})").Where(a=>!string.IsNullOrEmpty(a)).ToArray();