How do we get rid of the 'new lines' symbols '(\r\n)' when using Python to retrieve emails? 1
Asked
Active
Viewed 30 times
1 Answers
0
Using
s = "ABCD\n\r"
s = s.replace("\n", "")
s = s.replace("\r", "")
print(s)
Gives the output:
ABCD
Use replace
instead of strip
since it does not care about the placement of the speciefied character.

JakobVinkas
- 1,003
- 7
- 23