[solved] QRegExp to add spaces every 2nd character ?
-
How the QRegExp should be designed ...
@ QString pacA = "CC0D00FF6F00A8C0FFFFFFFF0000";
qDebug() << pacA;
QString pacB = pacA.replace(QRegExp("."), " " );
qDebug() << pacB;@... to get: "CC 0D 00 FF 6F 00 A8 C0 FF FF FF FF 00 00"
pacA is created by reading a QByteArray filled with Byte data from QSerialPort.
Maybe there's a possibility to add the space directly when reading the QByteArray ? -
You're welcome !
You have a little regexp tool in Qt's example that helps write/test QRegExp.
Now that it's working, please update the thread title prepending [solved] so other forum users may know a solution has been found :)
-
Currently, yes, but that might change in the future (following the thread of our new community manager)