I have a few words in a list that are of the type '\uword'
. I want to replace the '\u'
with an empty string. I looked around on SO but nothing has worked for me so far. I tried converting to a raw string using "%r"%word
but that didn't work. I also tried using word.encode('unicode-escape')
but haven't gotten anywhere. Any ideas?
EDIT
Adding code
word = '\u2019'
word.encode('unicode-escape')
print(word) # error
word = '\u2019'
word = "%r"%word
print(word) # error