Hello All
As part of json response, I am getting a QString with multiple carriage returns.
I need support in removing them , as the string is of quite a big size.
I tried using
Please find the string attached as a file.
Printable View
QString::siimplified() should work, it should leave you with one newline everywhere. If you want to remove all newlines then use QString::remove() passing '\n' as the frst argument. However I don't understand why you'd want to remove those new lines.
If you use the QJsonDocument, QJsonArray, and QJsonObject classes, it should simplify your parsing of the JSON data. If you need to store the JSON response in a compact format, the QJsonDocument::toJson() method has an argument that determines whether the resulting string is QJsonDocument::Indented (formatted with line breaks and indenting) or QJsonDocument::Compact (no formatting or line beaks).
Disregard if you're using an old version of Qt that doesn't have the QJson* classes, but if possible, these will simplify your life!