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. Easiest way to get substring from QString in Qt

Easiest way to get substring from QString in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++qstringqstringlistsubstringregex
2 Posts 2 Posters 1.0k 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.
  • L Offline
    L Offline
    learnist
    wrote on 22 Sept 2020, 19:52 last edited by
    #1

    this is my string <Resize animated="true" speed="4" height="200%" width="depends" /> ,in this , i want to extract substrings which are enclosed in " " , in this example true,4,200,depends,

    how to accomplish that ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Sept 2020, 19:57 last edited by
      #2

      Hi,

      One possible way is to use QRegularExpression::match or since it looks like xml, you can use QXmlStreamReader.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4

      1/2

      22 Sept 2020, 19:52

      • Login

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