Remove all hex characters from string in Python
问题 Although there are similar questions, I can't seem to find a working solution for my case: I'm encountering some annoying hex chars in strings, e.g. '\xe2\x80\x9chttp://www.google.com\xe2\x80\x9d blah blah#%#@$^blah' What I need is to remove these hex \xHH characters, and them alone, in order to get the following result: 'http://www.google.com blah blah#%#@$^blah' decoding doesn't help: s.decode('utf8') # u'\u201chttp://www.google.com\u201d blah blah#%#@$^blah' How can I achieve that? 回答1: