CSharp examples for System:Array Element
For Each element in an array do Action
using System;//from ww w. j a v a2 s . co m public class Main{ public static void ForEach(this Array e, Action<int> a) { for (int i = 0; i < e.Length; i++) { a(i); } } public static void ForEach<T>(this T[] e, Action<T, int> a) { for (int i = 0; i < e.Length; i++) { a(e[i], i); } } }