我将使用正则表达式,因为您可能并不总是使用Linq to SQL。
像这个Linq to Objects的例子
List<string> list = new List<string>();list.Add("This is a sentence.");list.Add("This is another one.");list.Add("C# is fun.");list.Add("Linq is also fun.");System.Text.Regularexpressions.Regex regEx = new System.Text.Regularexpressions.Regex("This");var qry = list .Where<string>(item => regEx.IsMatch(item)) .ToList<string>();// Print resultsforeach (var item in qry){ Console.WriteLine(item);}


