fork(2) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ProgramConsole
  6. {
  7. public class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. var list1 = new List<string>{
  12. "a", "b", "c"
  13. };
  14.  
  15. var list2 = new List<string>{
  16. "c", "d", "e"
  17. };
  18.  
  19. IEnumerable<string> dubvalues = list2.Intersect(list1);
  20.  
  21. foreach (var i in dubvalues)
  22. {
  23. Console.WriteLine(i);
  24. }
  25. }
  26. }
  27. }
Success #stdin #stdout 0.03s 33920KB
stdin
Standard input is empty
stdout
c