mario::konrad
programming / C++ / sailing / nerd stuff
C++ String Tokenizer
© 2005 / Mario Konrad

A simple string tokenizer. Searches for tokens, delemited with definable characters.

The usage of this class should be self explained. Example:

utils::string_tokenizer st("foo:bar:foobar", false, ":");
while (st.hasMoreTokens()) {
    cout << st.next() << "_" << endl;
    next();
}

It is also possible to use the automatic advancing feature:

utils::string_tokenizer st("foo:bar:foobar", true, ":");
while (st.hasMoreTokens()) {
    cout << st.next() << "_" << endl;
}