I have some text which is not clear and have so many tags and ascii as follow,
val =
"\nRated\xa0\n I have been to this place for dinner tonight.
\nWell I didn't found anything extraordinary there but indeed a meal worth
the price. The number of barbeque item and other both were good.\n\nFood: 3.5/5\"
So for making clear this tag I am using
val.text.replace('\t', '').replace('\n', '').encode('ascii','ignore').
decode("utf-8").replace('Rated','').replace(' ','')
and using multiple times replace I got my o/p as -
I have been to this place for dinner tonight. Well I didn't found anything extraordinary there but indeed a meal worth the price. The number of barbeque item and other both were good. Food: 3.5/5
I want to know that is there any way so I can use replace at once only for similar kind of replacement. like in this case -
replace('\t', '').replace('\n', '').replace(' ','')
translatetable to change each of the undesirable chars to the empty string.