110,566
社区成员
发帖
与我相关
我的任务
分享
string str = "SST1401A M 04 SST1501 L 05";
string[] array = str.Split(' ');
string[] temp=new string [3];
string [] temp1=new string [3];
int j = 0;
for (int i = 0; i < array.Length; i++)
{
if (i <= 2)
{
temp[i] = array[i];
}
else
temp1[j++] = array[i];
}
this.dataGridView1.Rows.Add(temp );
this.dataGridView1.Rows.Add(temp1);
this.dataGridView1.Rows[0].Cells[1].Value = "SST1401A M 04 \nSST1501 L 05"