首页 > Windows开发 > 详细

c#分割

时间:2015-10-23 11:58:32      阅读:167      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!