get next word in string

BlitzMax Forums/BlitzMax Beginners Area/get next word in string

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If I had a string:

"my birthday is tomorrow"

and a substring "my birthday is"

how could I get the next word after "my birthday is"?


you cant just subtract the strings from one another because the sentence could be longer:

e.g. "my birthday is tomorrow said bill"

and also the sentence could have different words on the front

e.g.

"and he said my birthday is tomorrow"


you can turn the string into an array of words

e.g.
the_string$="my birthday is tomorrow
local temp_array$[]=the_String.split(" ")

temp_array[0]="my"
temp_array[1]="birthday"

if that helps?