URG: How can you tranverse an Arraylist using foreach loop

  • Thread starter Thread starter Guest
  • Start date Start date
ArrayList sampleArrayList;

// Instanciate and fill the arrayList with eg instance of SampleData class
//...


// loop the array (assuming you have only SampleData instances in this
array)
foreach (SampleData sd in sampleArrayList)
{
// use sd to access current element
// ...
}


José
 
Nicole,

Although your question is answered, did you know that there is a special
newsgroup for C#.

microsoft.public.dotnet.languages.csharp

I hope this heps?

Cor
 
Back
Top