Create the Except query : Except « LINQ « C# / CSharp Tutorial





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 ShowExcept = First.Except(Second);

         Console.WriteLine("Except:");
         foreach (String ThisElement in ShowExcept)
            Console.WriteLine(ThisElement);

   }
}










22.39.Except
22.39.1.Create the Except query
22.39.2.One array expect another array
22.39.3.Use Except to print numbers that are in one integer array, but not another
22.39.4.Use Except to print the first character of product names that aren't also the first character of customer names.
22.39.5.Except Prototype
22.39.6.Set Operators: Except