how to check if any two value from array are equals c# code example
Example 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");
}
Example 2: see if two string arrays are equal c#
bool areEqual = a.SequenceEqual(b);