I have converted the binary result of a URL request into a text string, then attempted to replace the instances of '\r' with '' and '\n' with ' ' using the following code:
newvar = str(oldvar)
newvar.replace('\r', '')
newvar.replace('\n', ' ')
However when the variable newvar is printed to the log and written out to a file it retains the '\r' and '\n'. What am I doing wrong? I'm using the exact syntax suggested and that I had already read online.
Thanks