In C# you can:
foreach(string s in MyStrings)
Console.WriteLine(s);
Note that s is declared on the spot, the closes I've been able to find for VB is the following:
Dim s As String
For Each s In MyStrings
Console.WriteLine(s)
Next s
I much rather have:
ForEach s as String In MyStrings
Console.WriteLine(s)
Next s
because all the extra Dim lines in the middle of a function just to do a loop looks, feels, and smells sloppy, but putting them at the top of the function just looks messy. There has to be away to declare and use a variable in a loop in VB. I've noticed the same issue with a regular for loop.
foreach(string s in MyStrings)
Console.WriteLine(s);
Note that s is declared on the spot, the closes I've been able to find for VB is the following:
Dim s As String
For Each s In MyStrings
Console.WriteLine(s)
Next s
I much rather have:
ForEach s as String In MyStrings
Console.WriteLine(s)
Next s
because all the extra Dim lines in the middle of a function just to do a loop looks, feels, and smells sloppy, but putting them at the top of the function just looks messy. There has to be away to declare and use a variable in a loop in VB. I've noticed the same issue with a regular for loop.