score:37

Accepted answer
var results = dataset.where(i => !excluded.any(e => i.contains(e)));

score:-1

var result = dataset.where(x => !excluded.contains(x));

score:0

var result=dataset.where(x=>!excluded.exists(y=>x.contains(y)));

this also works when excluded list is empty.

score:7

try:

var result = from s in dataset
             from e in excluded 
             where !s.contains(e)
             select e;

score:14

// contains four values.
int[] values1 = { 1, 2, 3, 4 };

// contains three values (1 and 2 also found in values1).
int[] values2 = { 1, 2, 5 };

// remove all values2 from values1.
var result = values1.except(values2);

https://www.dotnetperls.com/except


Related Query

More Query from same tag