I have a list that contains only strings. What I would love to do is group by and return a count.
For instance:
Foo1 Foo2 Foo3 Foo1 Foo2 Foo2
var items= myList .GroupBy(g => g) .Select(t => new {count= t.Count(), key= t.Key }); foreach (var group in items) Console.WriteLine ( group.key + " " + group.count);