正则式,一句话,要引用using System.Text.RegularExpressions;
var str = "adkflsdllkqrr";
string[] result = Regex.Split(str, "(?<=\\G.{2})");
string a = "abcdefg";
string[] b = new string[a.Length];
for (int i = 0; i < a.Length / 2; i++)
{
b[i] = a.Substring(i*2,2);
Console.WriteLine(b[i]);
}
for循环 + substring()