C#字符串循环取值放到字符串数组中,急等,急,急
我想把str中的线路1,线路2……放到stringIn数组中,写的代码如下:运行结果总是显示,在stringIn中总是先显示8个线路0,先把8个线路0刷新成个线路1……
想请问这个循环如何写,谢谢了。
str="线路0线路1线路2线路3线路4线路5线路6线路7";
string[] stringIn=new string[8];
for(int x0=0;x0<str.Length;x0=x0+3)
for(int a=0;a<8;a++)
{
stringIn[a]=str.Substring(x0,3);
}