Reputation: 41
I am converting HTML data (data with bullet styling) to Java String, but we are getting junk values (��
- default Unicode value replaced) in the String, I tried to remove these values using replaceAll()
but it's not working.
Any suggestions about how to remove these Unicode characters from the String?
Upvotes: 1
Views: 1066
Reputation: 5756
You can remove all non-ASCII characters with:
s.replaceAll("[^\\p{ASCII}]", "")
Upvotes: 2