Results 1 to 14 of 14

Thread: Qstring bad index.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qstring bad index.

    Ah true, I probably should have read that a little closer.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qstring bad index.

    And I realize that in combination with your indexOf() code, you could do it in about 2 or 3 lines.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Apr 2021
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qstring bad index.

    My bad. Replace the 'd' in "HelloWorld" with 'e'.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qstring bad index.

    Replace the 'd' in "HelloWorld" with 'e'.
    Well, that won't happen either with your example, because 'e' comes before 'd' in your vowels string.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Apr 2021
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qstring bad index.

    Just put one of vowels characters at the end of newtext and test it.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qstring bad index.

    The code I posted earlier does exactly that. It replaces 'd' with 'o', the next character in the vowels string after 'd'.

    Obviously the code you posted in your first post is not your real code, otherwise it would do the same.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 3
    Last Post: 27th December 2013, 18:04
  2. Replies: 3
    Last Post: 27th July 2012, 09:30
  3. Replies: 2
    Last Post: 11th August 2011, 15:42
  4. Replies: 4
    Last Post: 31st January 2008, 20:44
  5. Replies: 6
    Last Post: 5th December 2007, 22: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
  •  
Qt is a trademark of The Qt Company.