static void Main(string[] args) { var grouper = new DuplicateGrouper <string>(); var result = grouper.GroupByDuplicate(new[] { "a", "b", "b", "b", "c", "c", "d" }); foreach (var r in result) { Console.WriteLine("Group".PadRight(16, '=')); foreach (var s in r) { Console.WriteLine(s); } } }
public static IEnumerable <IEnumerable <T> > Partition <T>(this IEnumerable <T> src) { var grouper = new DuplicateGrouper <T>(); return(grouper.GroupByDuplicate(src)); }