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. remove brackets when printing qstringlist
Qt 6.11 is out! See what's new in the release blog

remove brackets when printing qstringlist

Scheduled Pinned Locked Moved General and Desktop
qdebug
2 Posts 2 Posters 1.3k Views 1 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    When I do this

    QStringList list = QStringList() << "one" << "two";
    qDebug() << list;
    

    The output is (one,two)
    Is there a way of getting this without the brackets?

    Thanks

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Harism
      wrote on last edited by
      #2

      Using QStringList.join you could achieve desired results ;

      QStringList list = QStringList() << "one" << "two";
      qDebug().noquote() << list.join(", ");
      

      Playing around with this method quite likely gives you output you are after.

      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