Friday, June 1, 2012

LINQ Contains(string[]) instead of Contains(string)


string input = "aaa1236";
string[] toSearchFor = new string[3] { "aaa", "bbb", "ccc" };

var containsAll = toSearchFor.Any(x => input.Contains(x));