Text.Characters and index

I’m iterating over a Text variable like that:

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)?

[quote=195717:@Eli Ott]For Each char As Text In someText.Characters
// do something with char
Next[/quote]

That works fine. I guess as usually we will be reminded that iteration does not guarantee order, but it does seem (as usual) to respect order…

My question was:

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 ) )
  …

This works only for String. For Text this raises an InvalidArgumentException.

Sorry, my bad. Leave off the param entirely.

dim chars() as text = someText.Split

Great, and it is even almost as fast as For Each char As Text In someText.Characters.