Javatpoint Logo
Javatpoint Logo

LINQ Intersect Method

In LINQ, the Intersect method or operator is used to return the common elements from both the collections.

Here is the pictorial representation of the LINQ intersect method.

LINQ Intersect Method

LINQ Intersect method will combine both the collections into a single collection and return only the matching element from the collection.

Syntax of LINQ Intersect Method

The syntax of using the intersect method to get the matching elements from the multiple collections.

From the above syntax, we are combining the two collections to get the result as a single collection using the intersect method.

Example of LINQ Intersect Method

Here is the example of the LINQ Intersect Method.

Output:

LINQ Intersect Method




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA