2
說的列表中,我們有一個模型確定是否三個區域的人有任何關鍵字
public Foo
{
string Something {get;set;}
string SomethingElse {get;set;}
string AnotherThing {get;set;}
}
什麼是確定是否有這些字段包含從List
任何字符串的最簡潔的方式?
var foo = new Foo
{
Something = "If Liverpool don't beat Fulham this evening I will cry",
SomethingElse = "I hope I have that TekPub membership for Xmas",
AnotherThing = "I wish NCrunch was a bit cheaper"
};
var keywords = new List<string> { "Liverpool", "glosrob", "stackoverflow" };
會傳遞foo.Something
包含單詞'利物浦'。
請記住標記您的問題與相關語言(S)。我爲你解決了這個問題,但我希望2k +代表用戶知道如何在第一時間做到正確。 –