Array.ForEach with a delegate : Array ForEach « Data Structure « C# / CSharp Tutorial






using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;


public class MainClass
{

    public static void Main()
    {
        int[] array = new int[] { 8, 2, 3, 5, 1, 3 };
        Array.ForEach<int>(array, delegate(int x) { Console.Write(x + " "); });
        Console.WriteLine();
    }
}
8 2 3 5 1 3








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