This question is from the community. You should use the find method instead of contains.
Using
System;
Using
System. Collections. Generic;
Using
System. text;
Namespace
Leleapplication7
...
{
Class
Program
...
{
Static
Void
Main (
String
[] ARGs)
...
{
List
<
Int
[]
>
Alschedule
=
New
List
<
Int
[]
>
();
//
Declares a set 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
;
}
//
Whether the comparison length is the same
If
(Array1.getlength (
0
)
! =
Array2.getlength (
0
))
...
{
Return
False
;
}
//
Whether the comparison members are 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
;
}
}
}