最佳答案
举个简单的例子:
List<string> list = new List<string>() { "One", "Two", "Three", "three", "Four", "Five" };
CaseInsensitiveComparer ignoreCaseComparer = new CaseInsensitiveComparer();
var distinctList = list.Distinct(ignoreCaseComparer as IEqualityComparer<string>).ToList();
It appears the CaseInsensitiveComparer is not actually being used to do a case-insensitive comparison.
换句话说,清单包含与 名单相同数量的项目。相反,我期望,例如,“三”和“三”被认为是相等的。
我是不是漏了什么,还是因为独立接线员的问题?