LINQ - Check if String contains all keywords


I have a dictionary of array of string. The array of string have keywords I need to check on a string input. Example:

keywordArr = {“Banana”, “Apple”, “Orange”}

I need to check if the string have all the keywords in the array. Is there a method for this like keywords.Any(function(x) InputString.Contains(x)).ToString ?



How about the following condition?

keywords.All(function(x) InputString.Contains(x))


1 Like

That works! Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.