Code: Select all
Dim as String mr_str = "Hello_world_this_is_a_string"
Dim as String str_cont = ""
Dim as UInteger char_pos, start_pos = 1
Do
''get the information for the section of string
char_pos = Instr(start_pos, mr_str, "_")
print char_pos ''just left this in as a sanity check
''extract the string and print it to the screen
str_cont = Mid(mr_str, start_pos, char_pos - 1)
Print str_cont
''set a new start position
start_pos = char_pos + 1
Loop While char_pos <> 0
End
Here are the results I'm getting:
6
Hello
12
world_this_
17
this_is_a_string
20
is_a_string
22
a_string
0
string
Any idea why I'm not getting single words back, or why my count is off?