0

I have text: \\u5eca\\u574a\\u5e02. And I want to replace two backward slashes with one backward slash, ie. I would like the above text to be in the following format \u5eca\u574a\u5e02. How can I do this?

I tried with:

'\\u5eca\\u574a\\u5e02'.replace(r'\\u', r'\u')

But returning the same string, even though it is printing properly ie.

print('\\u5eca\\u574a\\u5e02'.replace(r'\\u', r'\u'))

will result in \u5eca\u574a\u5e02

R S John
  • 507
  • 2
  • 8
  • 16

0 Answers0