Wednesday 15 May 2013

utf 8 - QString QRegExp Remove Special Characters -


I have a custom with latitude / longitude data in the following format:

27 ° 34 '35.667 "45 ° 37 '28 .34"

I want to be able to strip / remove all special characters (°, ','), but I am not able to do this with the following code:

lat.remove (QRegExp (QString :: fromUtf8 ("[\\ ° \ '\"] "))));

When I print the results of latitude, Finds:

lat = "27 \ 260 34 35.67"

It looks like this and 'letter'

Any idea how to do this work? I would like to include the final format only empty space or letters = "27 34 35.67"

/ Div>

I was able to work with the following:

lat.remove (QRegExp (QString: : FromUtf8 ("[\ x00b0 \ '\"] ")));


No comments:

Post a Comment