Mega Code Archive

 
Categories / C# Tutorial / LINQ
 

Create the Intersect query

using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; public class MainClass{    public static void Main(string[] args){             String[] First = { "One", "Two", "Two", "Three", "Four" };          String[] Second = { "Three", "Four", "Five", "Six" };          var ShowIntersect = First.Intersect(Second);          Console.WriteLine("Intersect:");          foreach (String ThisElement in ShowIntersect)             Console.WriteLine(ThisElement);    } }