List<string> testList = new List<string>();
testList.Add("A");
testList.Add("A");
testList.Add("C");
testList.Add("d");
testList.Add("D");
該查詢重複區分大小寫:獲取從列表不區分大小寫
// Result: "A"
List<String> duplicates = testList.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
將如何看起來不區分大小寫? (結果: 「A」, 「d」)