mcuw mcuw - 1 year ago 243
C++ Question

QStringList remove spaces from strings

What a best way for trimming all strings in string list? I try to use replaceInStrings:

QStringList somelist;
// ... //
// add some strings
// ... //

but spaces not removed.

Answer Source

As another answer already told, you need to escape the backslash. You also want to change the expression to match one or more spaces and not 0 or more spaces, try using: QRegExp("^\\s+")

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download