您的位置:首页 > 编程语言 > C#

c#分割

2015-10-23 11:38 274 查看
Hashtable h = new Hashtable();
ArrayList l = new ArrayList();
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\尘梦\Desktop\root.txt", Encoding.Default);
int[] scores = new int[lines.Length];
int[] years = new int[lines.Length];
for (int i = 0; i < lines.Length; i++)
{
string rot = lines[i];
string[] rots = rot.Split('|');
scores[i] = Convert.ToInt32(rots[2]);
years[i] = Convert.ToInt32(rots[3]);

}
h.Add(years, scores);
l.AddRange(scores);
l.AddRange(years);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: