fork(1) download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var names = new[]{"John", "Doe", "Short", "Old"};
  11. var list = new List<List<string>>(){
  12. new[]{"John", "Doe", "Tall", "Old"}.ToList(),
  13. new[]{"John", "Doe", "Short", "Old"}.ToList(),
  14. new[]{"Jane", "Doe", "Tall", "Young"}.ToList(),
  15. new[]{"Jane", "Doe", "Short", "Old"}.ToList(),
  16. }.ToList();
  17.  
  18. List<List<string>> result = list
  19. .Where(l => l.SequenceEqual(names))
  20. .ToList();
  21. foreach(List<string> l in result)
  22. Console.WriteLine(string.Join(",", l.ToArray()));
  23. }
  24. }
Success #stdin #stdout 0.03s 33960KB
stdin
Standard input is empty
stdout
John,Doe,Short,Old