CSharp examples for System.Collections.Generic:IList
Flats the specified list of list.
using System.Collections.Generic; using System.Collections; using System;//ww w . ja v a2s.c om public class Main{ /// <summary> /// Flats the specified groups. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="groups">The groups.</param> /// <returns></returns> public static List<T> Flat<T>(List<List<T>> groups) { List<T> items = new List<T>(); foreach (List<T> group in groups) { items.AddRange(group); } return items; } }