對不起..我問了一個非常類似的問題早。但是這一次,我希望檢索某些字符結尾的單詞如何返回以某些字符開頭和結尾的所有單詞?
我有一個單詞列表如下
List<string> words = new List<string>();
words.Add("abet");
words.Add("abbots"); //<---Return this
words.Add("abrupt");
words.Add("abduct");
words.Add("abnats"); //<--return this.
words.Add("acmatic");
//Now return all words of 6 letters that begin with letter "a" and has "ts" as the 5th and 6th letter
//the result should return the words "abbots" and "abnats"
var result = from w in words
where w.Length == 6 && w.StartsWith("a") && //????