using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { var A = new[] {"1","2","3"}; var B = new[] { "1,2,3,4,5,6,7", "1,2,6,7", "1", "4,5,6", "6,7" }; var matches = B.Where(s => s.Split(',').Intersect(A).Any()).ToList(); foreach(var match in matches) Console.WriteLine(match); } }