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.

Global haystack:String = "did you know my birthday is tomorrow said bill"
Global needle:String = "my birthday is "


Local pos:Int = haystack.find(needle)
Local remainder:String = haystack[ pos + Len(needle)..]
Local birthday:String = remainder[0.. remainder.find(" ")]

Print birthday