remove r n from string code example
Example 1: remove n string
a_string = a_string.rstrip("\n")
Example 2: remove r and n from string python
stocks = [x.replace("\r\n","") for x in stocks]
a_string = a_string.rstrip("\n")
stocks = [x.replace("\r\n","") for x in stocks]