I can do the following replacement:
r"kr\xdf6;ger". replace('\\','& #')
-> 'kr෶ger'
But how can I do this using a variable which contains the above string?
Obviously, the following code returns not the string with replacement
but the name of the variable itself:
name = "kr\xdf6;ge r"
r"name".replace ('\\','&#')
-> 'r"name"
Sorry, if this is a stupid question but I have not found an answer so
far (or I have been using the wrong keywords for searching).
Thanks for any help.
Regards,
Marc
r"kr\xdf6;ger". replace('\\','& #')
-> 'kr෶ger'
But how can I do this using a variable which contains the above string?
Obviously, the following code returns not the string with replacement
but the name of the variable itself:
name = "kr\xdf6;ge r"
r"name".replace ('\\','&#')
-> 'r"name"
Sorry, if this is a stupid question but I have not found an answer so
far (or I have been using the wrong keywords for searching).
Thanks for any help.
Regards,
Marc
Comment