String tokenizer

BlitzMax Forums/BlitzMax Programming/String tokenizer

RepeatUntil(Posted 2005) [#1]
Hi,

I have written a simple tokenizer for BlitzMax (like the one in java). For example, you can separate the string "Hello/Blitz/Max" into 3 parts if you use the delimiter "/". That's useful in many cases.
Please run the code to see some examples of use. Please tell me if you find this useful. I plan to add some other useful string library like this one if people are interested.
(By the way, that's my first BlitzMax program!)



BlitzSupport(Posted 2005) [#2]
Nice!


Perturbatio(Posted 2005) [#3]
cool, I wrote one a while ago (in an attempt to create basic scripting), it isn't perfect though.

( http://www.blitzbasic.com/Community/posts.php?topic=42270#473596 )


rdodson41(Posted 2005) [#4]
You could also make a sort of lex thing where your function reads from a string or even a stream and looks for patterns, and when it does it you could have it do something.


Red(Posted 2005) [#5]
thx


RepeatUntil(Posted 2005) [#6]
I will create more useful text functions as a library. I have plenty of useful one coming from Cod2Doc. I just have to port them to BlitzMax!

@Rich05: what do you mean by lex? Could you give me an example of what you mean?