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 split QByteArray whit multi char

how to split QByteArray whit multi char

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 5.1k 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.
  • A Offline
    A Offline
    ARASHz4
    wrote on last edited by ARASHz4
    #1

    hi
    how can do this

    byteArrayList = byteArray.split("*/*");
    
    JonBJ 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      you can try to convert it to a QString and use its spit that
      takes a string and not char as sep.

      1 Reply Last reply
      2
      • A ARASHz4

        hi
        how can do this

        byteArrayList = byteArray.split("*/*");
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @ARASHz4
        There is no "multi-char split" for a QByteArray. One of:

        • Convert to QString and split if you can safely treat it as a string.

        • Use one of the overloads of QByteArray::indexOf() in a loop to implement your own "split" (which ultimately is doubtless the code split() uses anyway).

        1 Reply Last reply
        0

        • Login

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