Array.ForEach with a delegate : Array ForEach : Data Structure C# Examples


C# Examples » Data Structure » Array ForEach »

 

Array.ForEach with a delegate









    
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();
        }
}
    
   
  
   



Output

8 2 3 5 1 3


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array ForEach