我该如何构造一个LINQ表达式来从一个列表中删除符合返回布尔值的函数的条件的值?LINQ列表布尔函数的帮助
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;
}
我的结局字符串数组现在应该是:
message = {"days","week"}
我应该怎么改?我的消息数组从不改变。
啊..好吧..我会尝试这个。谢谢 ! – 2010-07-10 16:33:14