Results 1 to 2 of 2

Thread: case insensitive comparison.

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default case insensitive comparison.

    Hi,

    How can compare two QStrings case insensitively ?

    For ex: "Data" == "data" should return true

    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: case insensitive comparison.

    Use:
    Qt Code:
    1. str1.toUpper() == str2.toUpper()
    To copy to clipboard, switch view to plain text mode 
    or write your own version of compare().

Similar Threads

  1. How to make QAction::shortcuts case insensitive
    By jyoti kumar in forum Qt Programming
    Replies: 3
    Last Post: 10th September 2007, 09:23

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
  •  
Qt is a trademark of The Qt Company.