Q:

How do I access things returned by GroupBy

Ridiculously simple question that for the life of me I cant figure out. How do I 'get' at the values returned by GroupBy?
Take simple example below. I want to print out the first value that occurs more than once. Looking at the output in the watch window (image below) it sort of suggests that list3[0][0] might get at "one". But it gives me an error.
Note, I'm looking for the general solution - ie understanding what GroupBy returns.
Also, I would like to use the watch window to help me figure out for my self how I would access variables (as I find much of MSDN reference incomprehensible) - is this possible?
var list1 = new List<String>() {
            "one", "two", "three", "one", "two"};

var list3 = list1
            .GroupBy(x => x)
            .Where(x => x.Count() > 1)
            .ToList();

Console.WriteLine("list3[0][0]=" + list3[0][0]); //error

A:

While the VS debugger shows you an "index" number because the underlying type is a collection, the grouping is exposed as an IGrouping<T> that does not have an indexer.  If you just want the first item in the first group do:
Console.WriteLine("list3[0][0] =" + list3.First().First()); 

If you want to see all if the items you cam loop through the groupings:
int gi = 0, ii = 0;
foreach(var g in list3)
{
    foreach(item i in g)
    {
        Console.WriteLine("list3[{0}][{1}] = {2}", gi, ii, i); 
        ii++;
    }
    gi++;
}

