How To Apply Filter In List By Another List

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4.   
  5. namespace filterInlistusingAnotherList  
  6. {  
  7.     class Program  
  8.     {  
  9.         public static void Main(string[] args)  
  10.         {  
  11.             List<string> City1 = new List<string> { "Agra""Noida" };  
  12.             List<string> City2 = new List<string> { "Delhi","Agra""Noida""Ghaziabad" };  
  13.              
  14.             City2.Where(x => City1.Count(y => x.Contains(y)) == 0).ToList<string>().ForEach(x => Console.WriteLine(x));  
  15.               
  16.             Console.ReadKey();  
  17.         }  
  18.     }  
  19. }