Hey Guys,

I got a QByteArray containing some data. I distinguish different kinds of data via key characters which I prepend with a '&' character. Currently the data QByteArray only contians something like this: data = "&t02.04.2014".

Qt Code:
  1. void foo(QByteArray data){
  2.  
  3. QList<QByteArray> cmdList = data.split('&');
  4.  
  5. if(cmdList.size() != data.count('&')) dispError("Command List size != number of '&'");
  6. //At this point the cmdList contains 2 elments where the first one is empty (presuming the data array is like noted above.
  7.  
  8. //do fancy stuff with the data
  9. }
To copy to clipboard, switch view to plain text mode 

I don't quite understand why there are two elments in the QList as I am only expecting one.