Helpful Information
 
 
Category: C Programming
C++ String Tokenizer Class Wanted

Hello there all: I am a Java programmer doing some C++ work at the moment. I dearly miss the functionality of a StringTokenizer class in C++. The one in Java is very good and I have come somewhat dependant upon it. I have downloaded a string tokenizer class in C++ but it is not very good (in my opinion)
Can anybody advise me on how to tokenize strings (that are actually read from a file) so that i may analyse each token in the string in C++? Or better still can someone give me a link to a C++ string tokenizer class?

Possible places to try:

http://www.boost.org/

http://www.codeproject.com

As already mentioned, Code Project has what you're looking for:

http://www.codeproject.com/string/tokenizer.asp
http://www.codeproject.com/string/ctokenex.asp

My recommendation would be to try this library:

http://www.partow.net/programming/stringtokenizer/index.html

It gets the job done quiet well! :)



Arash Partow

__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net

i know you mentioned that you wanted a class, but the strtok function in the stdlib is still quite powerful and efficient if you want plain and simple tokenization.

..

LOL, gotta love google ads, they have links for "mandolin guitar strings" on there.

Also, if you're on a unix box - consider lex & possibly yacc.










privacy (GDPR)