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 -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -