我想組由下列元組:C#列表<組<字符串,字符串,整數>>組由最小值最大值INT
List<Tuple<string, string, int>> tu = new List<Tuple<string, string, int>>();
tu.Add(new Tuple<string, string, int>("a", "b", 201601));
tu.Add(new Tuple<string, string, int>("a", "b", 201602));
tu.Add(new Tuple<string, string, int>("a", "b", 201603));
tu.Add(new Tuple<string, string, int>("c", "d", 201601));
tu.Add(new Tuple<string, string, int>("c", "d", 201602));
的結果應該是這樣的一個新的記錄:
//Item1, Item2, Min(Item2), Max(Item3)
List<Tuple<string, string, int, int>> newtu = new List<Tuple<string, string, int, int>>();
a,b,201601,201603
c,d,201601,201602
你能幫我嗎?
*我想* =>好了,但什麼也來試試? –