<div dir="ltr"><div><div><div>Hi Dylan,<br><br></div>trimmed() removes whitespaces only. You need to replace \" with an empty string and "escape" both \ and ". You need escaping because this is how string literals in C/C++ work. Try calling str.replace("\\\"", ""), where str an object of QString.</div><div><br></div><div>Also note that trimmed() is a const method and does not change the object for which it was called. I.e. <br></div><div><br></div><div>QString str1 = " a ";</div><div>str1.trimmed();</div><div>// str1 is unchanged but returns a QString object which is "a"<br></div><div><br></div>Cheers<br></div>Dmitriy<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 12, 2017 at 12:25 PM, Dylan Van Assche via Devel <span dir="ltr"><<a href="mailto:devel@lists.sailfishos.org" target="_blank">devel@lists.sailfishos.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,<br></div><div><br></div><div>I'm reading the sfos-release and the hw-release file in /etc from C++ but for some lines I get this in my strings as output: <br></div><div><br></div><div class="m_6315283050251290310protonmail_signature_block m_6315283050251290310protonmail_signature_block-empty"><div class="m_6315283050251290310protonmail_signature_block-user m_6315283050251290310protonmail_signature_block-empty"><div><br></div></div><div class="m_6315283050251290310protonmail_signature_block-proton m_6315283050251290310protonmail_signature_block-empty"><br></div></div><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:rgb(170,0,0)" class="m_6315283050251290310colour">"\"Intex Aqua Fish\""</span><br></p><div><br></div><div>I tried trimmed() and remove() but I can't figure out how to clean it correctly. The \" characters are annoying.<br></div><div><br></div><div>Kind regards,<br></div><div>Dylan Van Assche</div><div><br></div><br>______________________________<wbr>_________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.<wbr>sailfishos.org</a><br></blockquote></div><br></div>