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));

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete