foreach with Arrays : Array ForEach « Data Structure « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {
    int[] array = new int[]{1, 2, 3, 4, 5, 6};
    
    foreach (int item in array)
    {
        System.Console.WriteLine(item);
    }

   }
}








11.15.Array ForEach
11.15.1.Array.ForEach with a delegate
11.15.2.An Action triggered by Array.ForEach
11.15.3.Use an Action to change the values
11.15.4.foreach with Arrays
11.15.5.Foreach and string index