Hi,
I have a List of String from which I get all values and the count of each value. This is stored into an IEnumerable variable. So I get a (Value, Count) pair in the IEnumerable. I wish to get only the count from the Value, Count pair depending on the Value. Can I get this in one line of code using LINQ? I did manage to get the value. But how do I
display this in the console? Here is my code.
Thanks
I have a List of String from which I get all values and the count of each value. This is stored into an IEnumerable variable. So I get a (Value, Count) pair in the IEnumerable. I wish to get only the count from the Value, Count pair depending on the Value. Can I get this in one line of code using LINQ? I did manage to get the value. But how do I
display this in the console? Here is my code.
VB.NET:
Dim i As IEnumerable = attRefs.GroupBy(Function(x) x).[Select](Function(g) New With { _
Key .Value = g.Key, _
Key .Count = g.Count() _
}).OrderByDescending(Function(x) x.Count)
Dim at = (From it In i Where it.Value = "12345" Select it.count)
Thanks