This question comes from a community question and should be found using the Find method rather than contains
Using System;
Using System.Collections.Generic;
Using System.Text;
Namespace ConsoleApplication7
... {
Class Program
... {
static void Main (string[] args)
... {
list<int[]> alschedule = new list<int[]> ()//Declaration of a collection of int[] elements
Alschedule.add (new int[) ... {1, 2, 3});
Alschedule.add (new int[) ... {1, 2, 3, 4});
Int[] result = Alschedule.find (findelements);
if (Result!= null)
... {
Console.WriteLine (result);
}
Console.read ();
}
private static bool Findelements (int[] arrint)
... {
Return Isequals (Arrint, new int[] ... {1, 2, 3});
}
public static bool Isequals (array array1, array array2)
... {
Whether the comparison type is the same
if (! Object.referenceequals (array1. GetType (), Array2. GetType ()))
... {
return false;
}
Compare whether the length is the same
if (array1. GetLength (0)!= array2. GetLength (0))
... {
return false;
}
Compare whether members correspond equal
ValueType V1, v2;
for (int i = 0; i < array1. GetLength (0); i++)
... {
V1 = (valuetype) array1. GetValue (i);
V2 = (valuetype) array2. GetValue (i);
if (!v1. Equals (v2))
... {
return false;
}
}
return true;
}
}
}