-3

I have some strings like this in Python: ' سلام دوستان;\xa0\xa0ج\xa0۲ \xa0ص\xa0۳۸۸ مى شود راهی پیدا کرد\u200c' How I can remove all \xa0 and \u200* characters from the strings?

1 Answers1

0

You can use the replace method , to replace those characters with empty string.

original_string =  'سلام دوستان;\xa0\xa0ج\xa0۲ \xa0ص\xa0۳۸۸ مى شود راهی پیدا کرد\u200c'

new_string = original_string.replace('\xa0','').replace('\u200','')
Flavio Adamo
  • 404
  • 2
  • 7