fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7.  
  8. public static void Main()
  9. {
  10. var List1=new[] {"123456", "432978", "321675", "321675" };
  11. var List2 = new[] { "7674543897", "1234568897", "8899776644" };
  12.  
  13. var match = from str1 in List1
  14. join str2 in List2
  15. on str1 equals (str2.Length < 6 ? str2 : str2.Substring(0, 6))
  16. select str2;
  17. foreach(string s2 in match)Console.WriteLine(s2);
  18. }
  19. }
  20.  
  21.  
  22.  
Success #stdin #stdout 0.04s 34984KB
stdin
Standard input is empty
stdout
1234568897