c#分割

Hashtable h = new Hashtable();
ArrayList l = new ArrayList();
string[] lines = System.IO.File.ReadAllLines(@"C:Users尘梦Desktop oot.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);

原文地址:https://www.cnblogs.com/mengluo/p/4903982.html