hallo everybody,
there is a funtion in MFC named CStringT::Tokenize,
how can i do it with QString?
Thanks!
hallo everybody,
there is a funtion in MFC named CStringT::Tokenize,
how can i do it with QString?
Thanks!
What kind of tokenization do you need?
There is no such thing available in QString anyway but you can achieve similar effect using the split() methods (if the kind of tokenization you need allows it, e.g. tokens limited by whitespaces).
Otherwise you'll have to implement a tokenization algorithm yourself.
Current Qt projects : QCodeEdit, RotiDeCode
The original code is like this:
cstring_a = cstring_b.Tokenize(",. %#", token_postion);
Problem is the ",. %#",..
try something like that (untested)
Qt Code:
To copy to clipboard, switch view to plain text mode
If the first character string is a list of token delimiter then what caduel suggested should work, except that he forgot to escape the backslash (does the dot needs to be backslashed inside a set anyway?) :
Qt Code:
To copy to clipboard, switch view to plain text mode
Current Qt projects : QCodeEdit, RotiDeCode
Bookmarks