Looping through ArrayList using Enumerators

Webmaster
Posted by Webmaster under C# category on | Views : 4489
Looping through an ArrayList using Iterators.

string str = string.Empty;
IEnumerator enm = myArrayList.GetEnumerator();
while (enm.MoveNext())
{
str += enm.Current.ToString() + " :";
}

Comments or Responses

Posted by: Webmaster on: 9/26/2008 Level:HonoraryPlatinum | Status: [Administrator]
Cool, its easy and so compact code.

Login to post response