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