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. Get the part of one QString
Forum Updated to NodeBB v4.3 + New Features

Get the part of one QString

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • RIVOPICOR Offline
    RIVOPICOR Offline
    RIVOPICO
    wrote on last edited by
    #1

    Hi normally when i need to get one string separated in different strings in c++, i do the array conversion and then get the letters that i need. In QT how i can get the first letters like for example:
    QString = "Test" I want to get the two first letters. I need to change to array , what recommend me.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi!

      how i can get the first letters

      QString QString::left(int n) const

      See https://forum.qt.io/topic/71894 and http://doc.qt.io/qt-5/qstring.html

      RIVOPICOR 1 Reply Last reply
      4
      • ? A Former User

        Hi!

        how i can get the first letters

        QString QString::left(int n) const

        See https://forum.qt.io/topic/71894 and http://doc.qt.io/qt-5/qstring.html

        RIVOPICOR Offline
        RIVOPICOR Offline
        RIVOPICO
        wrote on last edited by
        #3

        @Wieland sorry again you are right!

        ? 1 Reply Last reply
        0
        • RIVOPICOR RIVOPICO

          @Wieland sorry again you are right!

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @RIVOPICO :-)

          RIVOPICOR 1 Reply Last reply
          0
          • ? A Former User

            @RIVOPICO :-)

            RIVOPICOR Offline
            RIVOPICOR Offline
            RIVOPICO
            wrote on last edited by
            #5

            @Wieland two hours after sorry for opening this but .. if i want to take since thirst letter not counting since left or right in other words if i use right and this is the string "Newforum" and i take right string.right(8) but i change the string "New fórum more longer" then? i need only take since 3 and sorry but i was searching checking and i am can't solve this .

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              QString::mid http://doc.qt.io/qt-5/qstring.html#mid

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              2

              • Login

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