I have quite large amount of text which include control charachters like \\n \\t and \\r. I need to replace them with a simple space--> \" \". What is the fastest way to do this
You may also try regular expressions:
import re regex = re.compile(r'[\n\r\t]') regex.sub(' ', my_str)