Click to See Complete Forum and Search --> : For Loop


Cristiane
August 20th, 2003, 01:00 PM
Hi,

Is possible to do a loop with C# like in VB? It means, in VB I do:
For each obj in hashTable.values
ajfjafjakfa
Next

How could I do that in C#?
Thanks
Cristiane

Acephalus
August 20th, 2003, 02:10 PM
In C# you can do:string[] words = new string[] {"Hello","there"};
foreach(string word in words)
MessageBox.Show(word);