I have an array of search terms, and a setence. I need to test that the sentence contains all the search terms:
var searchTerms = "fox jumped".Split(' ');
var sentence = "the quick brown fox jumped over the lazy dog".Split(' ');
var test = sentence.Contains(searchTerms);
I exptected test to be True — howerver I get a compile error:
‘string[]’ does not contain a definition for ‘Contains’ and the best extension method overload ‘System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)’ has some invalid arguments
How should I test that sentence contains all the search terms?
You’re trying to check whether there are any search terms that don’t appear in the sentence: