Lambda Syntax
其实完全可以看成一种方法
[param list] => expression
method(param list){
expression
}
看上去是很像
小例子
其实完全可以看成一种方法
[param list] => expression
method(param list){
expression
}
看上去是很像
List<string> lastNames = new List<string> { “Einstein”, “Gore”, “Mayo” };
var famousPeople = lastNames.FindAll(lastName => lastName != “Mayo”);
famousPeople.ForEach(lastName => Console.WriteLine(lastName)
小例子