LINQ - Check if String contains all keywords

Hello,

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 ?

Thanks!

Hi,

How about the following condition?

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

Regards,

2 Likes

That works! Thank you!

1 Like

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