View Full Version : paticualr string
mouni
21st November 2016, 06:53
QString str = "{“resultâ€:0,“commandâ€: “frontend_get_infoâ€,“commandIdâ €:0,“bitErrorRateâ€:0,“noiseR atioâ€:28,“errorâ€: “xxxâ€,“lockStatusâ€: “lockâ€}";
i want to get only value 28 from string ....
how can i get plz give some solution with code
Lesiok
21st November 2016, 07:06
This looks like JSON so use appropriate API.
mouni
21st November 2016, 07:07
yes it is json response
Ginsengelf
21st November 2016, 07:58
Hi, you can use QString::split to split the string at the comma, the iterate over the resulting QStringList and check for the key you are looking for, e.g. “noiseRatioâ€.
Although a real JSON API would probably be easier to use and more versatile.
Ginsengelf
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.