【发布时间】:2012-03-29 12:43:33
【问题描述】:
我有这个代码:
int[] g = new int[3] { 1, 2, 3 };
g.ToList().ForEach(f=>Console.Write(f));
对于数组中的每一项,我想执行一个Action....
int[]已经实现Ienumerable。
我想执行一个没有“ToList()”的动作
是否有任何其他解决方案(使用 one 行代码)来做到这一点(没有 toList?即使用其 IEnumerable 特性)
【问题讨论】: