How do I remove strange and unwanted Unicode characters (such as a black diamond with question mark) from a String?
Updated:
Please tell me the Unicode chara
Put the characters that you want to get rid of in an array list, then iterate through the array with a replaceAll method:
String str = "Some text with unicode !@#$";
ArrayList badChar = new ArrayList();
badChar= ['@', '~','!']; //modify this to contain the unicodes
for (String s : badChar) {
String resultStr = str.replaceAll(s, str);
}
you will end up with a cleaned string "resultStr" haven't tested this but along the lines.