码迷,mamicode.com
首页 > Windows程序 > 详细

c#分割

时间:2015-10-23 11:59:04      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

string[] lines = System.IO.File.ReadAllLines(@"C:\Users\尘梦\Desktop\root.txt", Encoding.Default);
            foreach (string a in lines) {
                string[] root = a.Split(new string[] { "|" },StringSplitOptions.RemoveEmptyEntries);
                int[] scores = new int[root.Length];
                int[] year = new int[root.Length];
                for (int i = 0; i < root.Length; i++) {
                    scores[i] =Convert.ToInt32(root[2]);
                    year[i] = Convert.ToInt32(root[3]);

                }
                h.Add(scores, year);
                
                
            }
             

            Console.ReadKey();
        }

 

c#分割

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!