1
我有幾個電話號碼,我的文件是這樣的:儲存號碼的文件轉換成二維數組
22 33 44 55
11 45 23 14
54 65 87 98
,我想救他們(我分裂後)在二維數組,如:
x[0][1]==33
我該怎麼做?
編輯:
我寫它的某些部分,我把註釋代碼:
StreamReader sr = new StreamReader(@"C:\Users\arash\Desktop\1.txt");
string[] strr;
List<List<int>> table = new List<List<int>>();
List<int> row = new List<int>();
string str;
while ((str = sr.ReadLine()) != null)
{
strr = str.Split(' ');//here how should i save split output in two dimension array??
}
TIA
'for' co使用LINQ可以更清晰地編寫。 – svick