Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to reverse an string?

How to reverse an string?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • RipleyR Offline
    RipleyR Offline
    Ripley
    wrote on last edited by
    #1

    Hello guys, i got have a little problem when trying turn around reverse a string that don't me which is the correct form to do. E.G.

    QString var = "variable";

    "var reverse " = "elbairav"

    It's the exactly thing that wanting to do. Thanks boys.

    Gojir4G 1 Reply Last reply
    0
    • RipleyR Ripley

      Hello guys, i got have a little problem when trying turn around reverse a string that don't me which is the correct form to do. E.G.

      QString var = "variable";

      "var reverse " = "elbairav"

      It's the exactly thing that wanting to do. Thanks boys.

      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by
      #2

      @ripley Hi,

      QString s = "variable";
      std::reverse(s.begin(), s.end());
      qDebug() << s;    //output "elbairav"
      
      1 Reply Last reply
      9
      • RipleyR Offline
        RipleyR Offline
        Ripley
        wrote on last edited by
        #3

        @Gojir4 thanks bro.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved