KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this List<object[]> List<object[]> olst = new List<object[]>(); olst.Add(new object[] { "AA1", 1 }); olst.Add(new object[] { "AA2", 1 }); olst.Add(new object[] { "AA2", 1 }); olst.Add(new object[] { "AA1", 1 }); olst.Add(new object[] { "AA1", 1 }); From olst , I need to produce a new List<object> to hold this: "AA1", 3 "AA2", 2 In other words, I need to group olst[x][0] and sum up olst[x][1] . I could use a for loop, but I was hoping someone could help me using lambda expressions and/or linq to accomplish this.
Tags (comma-separated)
Save Edits
Cancel