日期:2014-05-17 浏览次数:20480 次
StringBuilder sb = new StringBuilder();
sb.Append("aa");
sb.AppendLine("bb");
sb.Append("cc");
string[] array = Regex.Matches(sb.ToString(), @"\w{2}").OfType<Match>().Select(t => t.Value).ToArray();
StringBuilder sb = new StringBuilder();
sb.Append("aa");
sb.AppendLine("bb");
sb.Append("cc");
string[] a = new string[3];
a = Regex.Split(sb.ToString(), "(?<=\\G.{2})(?!$)").Select(x=>x.Replace("\r\n","")).ToArray();
string a1 = a[0];
string a2 = a[1];
string a3 = a[2];