Esempio n. 1
0
    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);
            }
        }
    }
Esempio n. 2
0
    public static IEnumerable <IEnumerable <T> > Partition <T>(this IEnumerable <T> src)
    {
        var grouper = new DuplicateGrouper <T>();

        return(grouper.GroupByDuplicate(src));
    }