赞
踩
需求: 数组中按顺序每次取5个,到最后,如果取不到,从头开始取
- int k = 0;
- //5个5个一取
- private List<DataUnity> RandomSort(List<DataUnity> list)
- {
- List<DataUnity> jiji = null; ;
- if (k >= 0 && k <= (list.Count - 1))
- {
- int vall = list.Count - k;
- if (vall >= 5)
- {
- vall = 5;
- }
- jiji = list.GetRange(k, vall);
- k += 5;
- }
- else
- {
- k = 0;
- int vall = list.Count - k;
- if (vall >= 5)
- {
- vall = 5;
- }
-
- jiji = list.GetRange(k, vall);
- k += 5;
- }
-
- return jiji;
- }
FR:徐海涛(hunk Xu)
QQ技术交流群:386476712
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。