Solved c++ quetion string- int get the last character
-
if I have many string like this:
"hello250"
"dog256454"
"boy14" and etc...
but the concept is always string->int
how can I get the last char before the number- integer? -
- Iterate along the characters in the string till you find a digit; or
QString::indexOf(QRegularExpression("m[0-9]"))
probably does this.
The last character before the digit is the index minus 1.
-
- Iterate along the characters in the string till you find a digit; or
QString::indexOf(QRegularExpression("m[0-9]"))
probably does this.
The last character before the digit is the index minus 1.