0

I have a pretty straightforward question and want to solve it in the best way possible. I know this can be solved with a simple loop but I would prefer using linq.

// Yields true because B contains all of A
IEnumerable<int> listA = new int[] { 1, 2, 3, 4 };
IEnumerable<int> listB = new int[] { 1, 2, 3, 4, 5, 6 };

// Yields false because B does not contain all of A
IEnumerable<int> listA = new int[] { 1, 2, 3, 4 };
IEnumerable<int> listB = new int[] { 2, 3, 4, 5, 6 };
Ivan Stoev
  • 179,274
  • 12
  • 254
  • 292
Tom el Safadi
  • 5,083
  • 5
  • 35
  • 83

0 Answers0