fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<string> list1 = new List<string>(){ "A", "C", "F", "H", "I" };
  10. List<string> list2 = new List<string>(){ "B", "D", "F", "G", "L" };
  11.  
  12. var intersect = list1.Intersect(list2);
  13.  
  14. foreach (var i in intersect)
  15. {
  16. Console.WriteLine(i);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.03s 33920KB
stdin
Standard input is empty
stdout
F