1 /// <summary> 2 /// 集合分组 3 /// </summary> 4 /// <param name="array">需要分组的集合</param> 5 /// <param name="size">每个分组的大小</param> 6 /// <returns></returns> 7 public static T[][] GroupArray<T>(T[] array, int size = 10) 8 { 9 List<T[]> lst = new List<T[]>(); 10 int count = array.Length % size == 0 ? array.Length / size : array.Length / size + 1; 11 for (int i = 0, length = count; i < length; i++) 12 { 13 var arr = array.Skip(i * size).Take(size); 14 lst.Add(arr.ToArray()); 15 } 16 return lst.ToArray(); 17 }