Answers for "compare two list in c# contains the same ida"

C#
3

c# how to check if two lists have same values

var list1 = new List<int> { 1, 2, 3, 1 };
var list2 = new List<int> { 2, 1, 3, 1 };
var list3 = new List<int> { 2, 2, 3, 2 };
bool areTheSame1 = list1.SequenceEqualsIgnoreOrder(list2); //True
bool areTheSame2 = list1.SequenceEqual(list2); //True
bool areTheSame3 = list1.SequenceEqual(list3); //False
Posted by: Guest on June-13-2020
1

check two lists are equal c#

List<int> list1 = new List<int> { 1, 2, 3 };
List<int> list2 = new List<int> { 1, 2, 3 };

if (list1.SequenceEqual(list2))
{
  Console.WriteLine("true");
}
else
{
  Console.WriteLine("false");
}
Posted by: Guest on November-01-2020

Code answers related to "compare two list in c# contains the same ida"

C# Answers by Framework

Browse Popular Code Answers by Language