I am trying to split a string according to delimiter the equevelant code in C# is :
char[] delimiterChars = { ' ', ',', '.', ':', '\t' }; String[] query = sometext.Split(delimiterChars);
but I want to do it in Qt
Use split function that accepts Qt Regular Expression.
QRegExp rx("(\\ |\\,|\\.|\\:|\\t)"); //RegEx for ' ' or ',' or '.' or ':' or '\t' QStringList query = sometext.split(rx);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With