Good day reader
I want to know how to do a couple of things with strings for instance
turn 123456 into 654321
then I also want to change the asci value of a character.
Here follows the code that I thought would fdo both of the above, could you correct me?
First query
Dim Str1 as Strings = "123456"
Dim Str2() as char = str1.tochararray
Dim st3() as char
Dim I as integer
dim J as integer
dim K as integer
J = len(str1)
for i = 1 to len(str1)
K = J+1-I
str3(i) = Str2(K)
next i
Str1 = Str3
this should turn str1 into "654321"
Second query
Dim Str1 as String = "ABC"
Dim Str2() as char = str1.tochararray
Dim Str3() as Char
Dim I integer
Dim J integer = 20
DIm Ch as char
For I = 1 to len(str1)
ch = chr(asc(Str2(i)+10)
Str3(i) = ch
next i
Str1 = Str3
This should turn str1 into "KLM"
Can someone tell me where I went wrong (I come from a Delphi background, the direct translated code for delphi would have worked but for some reason it doesn't work in VB)
Darkwing Duck aka DWduck signing off :)