Right now i am doing something like this to remove the words from myList, which is working ok,
List<string> myList = matches
.Cast<Match>()
.Select(m => m.Value)
.Distinct()
.ToList();
myList.RemoveAll((x) => x.Contains("word1")
|| x.Contains("word1")
|| x.Contains("word2")
|| x.Contains("word3")
|| x.StartsWith("D")
);
string[] ab = new string[] { "word1", "word2", "word3" };
But now I want to provide a string[] list instead adding x.Contains(“blah blah”)
Second I also want to combine both statements into one, making it a single linq query.
Enumerable.Except is your friend for filtering out items. You’ll need to do a final
Whereto handle theStartsWithcase.So in full: