score:17

Accepted answer

if you want to create a new list with only the items matching your condition:

list<string> result = urls.where(x => !mime.any(y => x.endswith(y))).tolist();

if you want to actually remove items from source, you should use removeall:

urls.removeall(x => mime.any(y => x.endswith(y)));

score:8

here is a one liner that fits your needs

urls.removeall(x => mime.any(y => x.endswith(y)));

maybe this is a safer appraoach

urls.removeall(x => mime.contains(path.getextension(x)));

when you have urls like http://stackoverflow.com/questions/dir/some.ashx?id=.pdf you should think about another approach


Related Query

More Query from same tag