using System;
using System.Collections;
using System.Collections.Generic;
namespace ForEachExaple
{
     public static class Utility
     {
         public static void ForEach(this IEnumerable coll, Action function)
         {
            IEnumerator en = coll.GetEnumerator();
            while (en.MoveNext())
            function(en.Current);
          }
     }
class Program
{
   static void Main(string[] args)
   {
      var array = new int[] { 1, 2, 3 };
      //Output : 123
      array.ForEach(val => Console.Write(val));
    }
 }
}

last60 225x300 [C#] : Come scansionare un Array con LINQ