This is easy in C, how would I do it in VB?
This is what I am trying right now.
Dim a As String = "a"
Dim b As String = "b"
Dim c As String = "c"
Dim d As String = "d"
For Each i in {a, b, c, d}
i = "blah" & i
End For
This doesn’t work because this is only modifying i and not the underlying variable.
What I really need is a pointer!?
VB’s
For Eachloop doesn’t support such a construct. That’s a pity but there are better ways anyway. Try to avoid loops in general:And in case that’s not valid VB (combining collection initialisers with method calls …) the following does work: