Re-enumerate the list : ArrayList : Data Structure C# Examples


C# Examples » Data Structure » ArrayList »

 

Re-enumerate the list









    
using  System;  
using  System.Collections;  
  
class  MainClass  {    
    public  static  void  Main()  {  
        ArrayList  list  =  new  ArrayList(1);  
  
        for(int  i=0;  i  <  10;  i++)  
            list.Add(i);  
  
        IEnumerator  etr  =  list.GetEnumerator();  
        while(etr.MoveNext())    
            Console.Write(etr.Current  +  "  ");  
  
        Console.WriteLine();  
  
          
        etr.Reset();  
        while(etr.MoveNext())    
            Console.Write(etr.Current  +  "  ");  
  
        Console.WriteLine();  
    }  
}
    
   
  
   



Output

0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» ArrayList