.NET Framework 哪里(过滤器)
示例
此方法返回一个IEnumerable,其中包含所有满足lambda表达式的元素
例
var personNames = new[] { "Foo", "Bar", "Fizz", "Buzz" }; var namesStartingWithF = personNames.Where(p => p.StartsWith("F")); Console.WriteLine(string.Join(",", namesStartingWithF));
输出:
狐狸
观看演示