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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top