For Each char As Text In someText.Characters
// do something with char
Next
One one character I have to peek the following one. Can this be done, or do I have to use a For loop with an index variable (which is magnitudes slower on larger texts of course)?
Instead of iterating, break it up into an array and walk it with a For loop.
dim chars() as text = someText.Split( "" )
for i as integer = 0 to chars.Ubound
dim thisChar as text = chars( i )
dim nextChar as text = if( i = chars.Ubound, "", chars( i + 1 ) )