110,535
社区成员
发帖
与我相关
我的任务
分享
a(?=b) 匹配b前面的a
a(?!b) 匹配不在b前面的a
(?<=a)b 匹配a后面的b
(?<!a)b 匹配不在a后面的b
string str = "1234567";
for (int i = 0; i < str.Length; i = i + 2)
{
string tempStr = new string(str.Skip(i).Take(2).ToArray());
Console.WriteLine(tempStr);
}
//magic, don't touch
var t = System.Text.RegularExpressions.Regex.Split(input, @"(?<=\G.{2})(?!$)");