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