• 注册
当前位置:1313e > 默认分类 >正文

c#分割

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);

 

转载于:https://www.cnblogs.com/mengluo/p/4903982.html

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 162202241@qq.com 举报,一经查实,本站将立刻删除。

最新评论

欢迎您发表评论:

请登录之后再进行评论

登录