我发现了一些非常奇怪的事情,希望能更好地理解。
var all = new List<int[]>{
new int[]{1,2,3},
new int[]{4,5,6},
new int[]{7,8,9}
};
all.ForEach(n => n.ForEach(i => Console.WriteLine(i)));
可以重新写成以下形式:
...
all.ForEach(n => n.ForEach(Console.WriteLine));
如何不使用 lambda 表达式参数 (i=>),仍然将当前项传递给 console.WriteLine?
感谢任何见解。 -Keith