Split string into several two character strings

后端 未结 4 2089
走了就别回头了
走了就别回头了 2020-12-17 05:56

I have this string 8S8Q4D1SKCQC2C4S6H4C6DJS2S1C6C

How can I split this string into substrings that consist of 2 characters per substring? I\'m confused

4条回答
  •  隐瞒了意图╮
    2020-12-17 06:42

    for (int i = 0; i < a[2].Length; i++)
    {
        string ss = (8S8Q4D1SKCQC2C4S6H4C6DJS2S1C6C).Substring(i, 2);
        Console.Write(ss);
        i++; 
    }
    

提交回复
热议问题