PDA

View Full Version : Part of QString



arturs
18th July 2015, 16:40
Hi

I have the following QString:
QString mystring
"QT TEST TR.=123456 PORT 23"

I need to copy only 123456 value to another QString.
123456 is variable value.

I tried to use mystring.section ("TR.=",1) but then is copied "123456 PORT 23"

I do not know how to limit copy to " ".


Regards
Artur

anda_skoa
18th July 2015, 17:27
You could use section() again on the result of the first section() call or use indexOf() twice, once to find the end of the prefix and once to find the end of the value and then use mid().

Cheers,
_