c#怪异的Lambda 语法



其实完全可以看成一种方法

[param list] => expression

method(param list){
   expression
}

看上去是很像
List lastNames = new List { “Einstein”, “Gore”, “Mayo” };
var famousPeople = lastNames.FindAll(lastName => lastName != “Mayo”);
famousPeople.ForEach(lastName => Console.WriteLine(lastName)


小例子

转载于:https://my.oschina.net/u/2296689/blog/545761

你可能感兴趣的:(c#怪异的Lambda 语法)