How could I construct a LINQ expression to remove values from one list that meet the criteria of a function that returns a boolean?
string[] message = "days of the week"
message.ToList().RemoveAll(c=>checkShortWord(c));
public static bool checkShortWord(string word) {
if ((word.Length > 3) &&
(!Regex.IsMatch(word, "^[0-9]+$")))
return true;
return false;
}
My ending string array should now be:
message = {"days","week"}
What should I change? My message array never changes.