trying to print "Success" in the console in the following code:
static void Main(string[] args)
{
List<int[]> listInt = new List<int[]>();
listInt.Add(new int[] { 1, 2 });
listInt.Add(new int[] { 3, 4 });
listInt.Add(new int[] { 5, 6 });
listInt.Add(new int[] { 7, 8 });
listInt.Add(new int[] { 9, 10 });
listInt.Add(new int[] { 11, 12 });
listInt.Add(new int[] { 12, 13 });
listInt.Add(new int[] { 13, 14 });
int[] testing = new int[] { 7, 8 };
if(listInt.Contains(testing))
{
Console.WriteLine("Success");
}
else
{
Console.WriteLine("Failure");
}
}
However it keeps printing "Failure". Does anyone have any simple solutions where I can test to see if a List<int[]>
contains the int[] testing
?