Results 1 to 4 of 4

Thread: Need SpanIncluding like method in QString

  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Need SpanIncluding like method in QString

    Hi All,


    Is there any method in Qt like SpanIncluding(LPCTSTR lpszCharSet ) which is in CString ?

    which will extracts characters from the string, starting with the first character, which are in

    the set of characters identified by lpszCharSet ?
    Thanks,
    Rajesh.S

  2. #2
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need SpanIncluding like method in QString

    QString & QString::remove ( const QRegExp & rx )
    This is an overloaded member function, provided for convenience.
    Removes every occurrence of the regular expression rx in the string, and returns a reference to the string. For example:
    QString r = "Telephone";
    r.remove(QRegExp("[aeiou]."));
    // r == "The"
    See also indexOf(), lastIndexOf(), and replace().

  3. #3
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need SpanIncluding like method in QString

    The correct copy of your function is this:

    Qt Code:
    1. QString r = "Telephone";
    2. r.remove(QRegExp("[^aeiou]"));
    3. // r == "eeoe"
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Need SpanIncluding like method in QString

    Thank you for your valuable reply
    Thanks,
    Rajesh.S

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. Replies: 4
    Last Post: 10th March 2007, 18:01
  3. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  4. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 08:55
  5. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:10

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.