Sometimes when I get input from a file or the user, I get a string with escape sequences in it. I would like to process the escape sequences in the same way that Python proc
Below code should work for \n is required to be displayed on the string.
import string our_str = 'The String is \\n, \\n and \\n!' new_str = string.replace(our_str, '/\\n', '/\n', 1) print(new_str)