PDA

View Full Version : How to recognize a letter from a Qstring?



luffy27
26th July 2007, 20:13
Hi guys:
I want to recognize a letter from a Qstring, just like "F", "B" or "S". But in my string there is also some number following these letters. I am looking for a way to distinguish letters from number when I search through my string. I have took a look at QString's member functions, but I couldn't find such functions to solve this problem.

Any suggestion is welcome.
ps: my string is like: T01F350B2000S1000C00500 , and these letters could appear at any position, they do not have a fixed consquence.

Thanks a lot.
Best regards.

marcel
26th July 2007, 20:17
Take a look at QString::at(int) and QChar::isLetter() and QChar::isDigit().

Regards

luffy27
26th July 2007, 20:22
Ha! That's what I want!
Thanks for you quick reply.
God bless you!