I have a plain string 'бекслеш \018 на точку'
in Python 3. I got this string from an external HTML page, therefore it doesn't have the "r" prefix of a raw string. I don't know how to convert it to a raw string.
How can I replace the '\'
with a dot '.'
?
I've tried the following:
s = get_string() # 'бекслеш \018 на точку'
print(s.replace('\\', '.'))
out: бекслеш 8 на точку
But I need 'бекслеш .018 на точку'
.
UPD: It is clear that the programming language interprets the backslash as a control character. Question: how to make a replacement, if it is not possible to specify a string as raw, or is it not clear how to convert it to raw?