c# - .Net equivalent of Java 'Collections.disjoint()' method? -


is there collections.disjoint() (java language) api or library .net (c#)?

from api description:

disjoint returns true if 2 specified collections have no elements in common.

it sounds you're looking linq intersect method:

bool disjoint = !collection1.intersect(collection2).any(); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -