I have some Unicode string in a document. All I want is to remove this Unicode code or replace it with some space (" "). Example =""
doc = "Hello my name is Ruth \u2026! I really like swimming and dancing \ud83c" How do I convert it to the following?
doc = "Hello my name is Ruth! I really like swimming and dancing" I already tried this: https://stackoverflow.com/a/20078869/5505608, but nothing happens. I'm using Python 3.
re.sub(r'[^\x00-\x7F]+',' ', text). the code works, but nothing changed @MarkRansomre.suband assign it back totext.