Results 1 to 3 of 3

Thread: How to recognize a letter from a Qstring?

  1. #1
    Join Date
    Nov 2006
    Posts
    58
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default How to recognize a letter from a Qstring?

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to recognize a letter from a Qstring?

    Take a look at QString::at(int) and QChar::isLetter() and QChar::isDigit().

    Regards

  3. #3
    Join Date
    Nov 2006
    Posts
    58
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to recognize a letter from a Qstring?

    Ha! That's what I want!
    Thanks for you quick reply.
    God bless you!

Similar Threads

  1. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 20:47
  2. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  3. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 08:55
  4. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:10
  5. [SOLVED] Widget plugin ... how to ?
    By yellowmat in forum Newbie
    Replies: 10
    Last Post: 29th January 2006, 20:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.