I understand to remove a single backslash we might do something like from Removing backslashes from a string in Python
I've attempted to:
I'd like to know how to remove in the list below all the words like '\ue606',
A =
['Historical Notes 1996',
'\ue606',
'The Future of farms 2012',
'\ch889',
'\8uuuu',]
to transform it into
['Historical Notes 1996',
'The Future of farms 2012',]
I tried:
A = ['Historical Notes 1996',
'\ue606',
'The Future of farms 2012',
'\ch889',
'\8uuuu',]
for y in A:
y.replace("\\", "")
A
It returns:
['Historical Notes 1996',
'\ue606',
'The Future of farms 2012',
'\\ch889',
'\\8uuuu']
I'm not sure how to address the string following the '\' or why it added a new '\' rather than remove it.