VB help, trying to ad spaces
Hello, ok I am trying to make a VB script to make a string with no spaces, have spaces added after every 2nd char, Basically make a hex converter, well sort of. Ok, this what I have:
1: Dim i As Integer
2: Dim old, tnew
3:
4: old = Text1.Text
5: tnew = Text2.Text
6:
7: For i = 0 To Len(old)
8: tnew = tnew & (Mid(old, i + 1, 1)) & " "
9: Next i
10: Text2.Text = tnew
This makes a space between every character: ex: hello! [converts to] h e l l o !
But I need it to be: hello! [converts to] he ll o!
I have tried: (Mid(old, i + 1, 2)) but this happens:
hello! [converts to] he el ll lo o! !
it seems to be copying the last character and then adding it to the next before continuing on.
Does anyone have any suggestions?
Thanks, -[El Miguel]-