I have two list like this:
a1 = { 1, 2, 3, 4, 5};
a2 = { 1, 3};
I want to check whether a2
is a consecutive subset of a1
. I use:
bool isSubset = !a2.Except(a1).Any();
Based on that example, isSubset
should be false
, but when I run, isSubset = true
.