【发布时间】:2016-03-13 07:36:42
【问题描述】:
如何确定List<List<int>> 中的项目是否相等?
List<List<int>> equals = new List<List<int>>()
{
new List<int>() { 1,2 },
new List<int>() { 1,2 }
};
List<List<int>> notEquals = new List<List<int>>()
{
new List<int>() { 1,2 },
new List<int>() { 2,500}
};
【问题讨论】:
-
列表
{1, 2}和{2, 1}是否相等?顺序重要吗? -
你有什么尝试吗?
-
@DmitryBychenko 顺序无关紧要。
-
@SergiiZhevzhyk 。没有重复。在我的示例中,我只有 2 个项目,但最终更多
-
@BobyOneKenobi:在这种情况下,接受的 Tim Schmelter 的答案是不是您正在寻找的答案:
SequenceEqual取决于订单。