码迷,mamicode.com
首页 > 其他好文 > 详细

查找List 某一段数据

时间:2014-07-21 11:26:55      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:list

代码如下: 

public void SelectData()

   {
            List<int> r = new List<int>();
            r.Add(1);
            r.Add(2);
            r.Add(3);
            r.Add(4);
            r.Add(5);
            r.Add(6);
            List<int> t = r.SkipWhile((n, index) => index < 3).ToList(); // 获取第3条以后的数据
            List<int> t2 = t.TakeWhile((n, index) => index < 1).ToList(); // 获取第1条以前的数据
    }

查找List 某一段数据

标签:list

原文地址:http://blog.csdn.net/coolfeiweb/article/details/38009987

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