我有一個3元組List<Tuple>
與string, string, string
。
初始化: List<Tuple<string, string string>> myTupleList = new List<Tuple<string, string, string>>();
我基本上想搜索Item2
中的值並刪除整個條目(如果找到)。
讓我想象。如果我有:C# - 如何從列表中刪除值<Tuple>
Item1 | Item2 | Item3
---------------------
"bar" | "foo" | "baz"
---------------------
"cat" | "dog" | "sun"
---------------------
"fun" | "bun" | "pun"
我想要做
//pseudocode
myTupleList.Remove("dog" in Item2);
做出的排行榜
Item1 | Item2 | Item3
---------------------
"bar" | "foo" | "baz"
---------------------
"fun" | "bun" | "pun"