I have a XML file which contains values having unwanted characters like
\xc2d
d\xa0
\xe7
\xc3\ufffdd
\xc3\ufffdd
\xc2\xa0
\xc3\xa7
\xa0\xa0
'619d813\xa03697'
\xe9.com
input examples could be
name : John Hinners\xc2d
email: abc@gmail\xe9.com
and others ....
desired output should be
name : John Hinners
email: abc@gmail.com
and others ....
I come from python background where this task can be done easily as
def remove_non_ascii(s):
return ''.join(i for i in s if ord(i)<128)
Is there some similar way to perform the same task in Java?