I need to replace spaces in a QString with backslash spaces.
I have: QString myPath = /home/matt/my file.txt
I need: QString myPath = /home/matt/my\ file.txt
I tried using myPath.replace(" ", "\ ");
but unfortunately the compiler interrupts this as an escape sequence.
The compiler uses
\
as an escape character in strings. You will need two backslashes.