I have a collection of strings. I need to find out from this collection strings which satisfies some condition e.g. that string contains A and B or C. These criteria are specified by the user so they are dynamic. In Linq it should be something like,
List<String> items = new List<string> { "sdsdsd", "sdsd", "abc"};
var query = from item in items
where item.Contains("a") && item.Contains("b") || item.Contains("c")
select item;
I want to make the where condition dynamic so that it can work for any input by the user. Is it possible to do this in C# without using any external library. Maybe using Linq or something else which is builtin into .Net framework.
Thanks, Gary