[問題] 請問split問題
請問我在c#上面要分割 如41 99 311 16
50 99 300 100
52 10 11 20
...
這四個數字
string[] words1 = Regex.Split(str,@"\s+");
textBox1.Text = words1[0];
textBox2.Text = words1[1];
textBox3.Text = words1[2];
textBox4.Text = words1[3];
經過以上可能變成
textBox1.Text = words1[0]=>41
textBox2.Text = words1[1]=>99
textBox3.Text = words1[2]=>311
textBox4.Text = words1[3];
但是有時候換另外一行又可以
請問為什麼有時候會缺一個
我的regex.split有少寫什麼嗎?(空格可能有tab鍵或空格+tab鍵等)
謝謝喔
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.69.149.252
→
09/04 20:01, , 1F
09/04 20:01, 1F
→
09/04 21:47, , 2F
09/04 21:47, 2F
討論串 (同標題文章)
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章