Iam developing a QT software which is using telnet commands to get some information from the adsl modem link. i got all those information to a QString
QString datarate = ui->output->toPlainText();
i want to select only a number after downstream rate
Downstream rate = 10239 Kbps
and convert it to integer to compare it with other numbers ... i don't want to take the first one which is = 20892 kbps
Status: Showtime
Max: Upstream rate = 1193 Kbps, Downstream rate = 20892 Kbps
Bearer: 0, Upstream rate = 1021 Kbps, Downstream rate = 10239 Kbps
any advices?? note : the number will be random so adsl status are much different
Maybe something like this will work:
QString datarate = ui->output->toPlainText();
int number = datarate.split("Downstream rate = ")[2].split(" ")[0].toInt();
This is taking the following steps: