Only if you enter 7 instead of 6, the last field will be recognized.
Or do I see this wrong ?
Code: Select all
string$=" Hello I am a splitted string "
For k = 1 To 6
Debug StringField ("_Hello_I_am_a_splitted_string_", k , "_")
Next
Code: Select all
string$=" Hello I am a splitted string "
For k = 1 To 6
Debug StringField ("_Hello_I_am_a_splitted_string_", k , "_")
Next
Code: Select all
string$ = " Hello I am a splitted string "
cnt = CountString(string$, " ")
Debug string$
For k = 1 To cnt
Debug "" + k + " > [" + StringField(string$, k , " ") + "]"
Next
string$ = "_Hello_I_am_a_splitted_string_"
cnt = CountString(string$, "_")
Debug string$
For k = 1 To cnt
Debug "" + k + " > [" + StringField(string$, k , "_") + "]"
Next
Code: Select all
a$="Field1+Field2+Field3"
Sep = CountString(a$, "+")
For I = 1 to Sep +1 ; don't forget to either increase the last step or...
Debug StringField(a$, I, "+")
Next
For I = 0 to Sep ; ... decrease the first step and shift the index below.
Debug StringField(a$, I +1, "+")
Next
Code: Select all
string$="_aaaaaaaaaa_Hello_I_am_a_splitted_"
Debug StringField(string$, 1 , "_")
Ups ...
Code: Select all
newList F$()
A$ = "_monday_tuesday_wednesday_"
Fmax = CountString(A$, "_") + 1
F = 1
Repeat
F$ = Trim(StringField(A$, F, "_") )
If F$
AddElement(F$() )
F$() = F$
EndIf
F + 1
Until F > Fmax