c++ - QStringList remove spaces from strings -


what best way trimming strings in string list? try use replaceinstrings:

qstringlist somelist; // ... // // add strings // ... // somelist.replaceinstrings(qregexp("^\s*"),""); 

but spaces not removed.

as answer told, need escape backslash. want change expression match 1 or more spaces , not 0 or more spaces, try using: qregexp("^\\s+")


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -