I have this sample String
with Cooking \u0026 Baking Needs \u002A
text having Unicodes what is the best way to replace all Unicodes with actual String? Like replace \0026
with &
etc.
This is my initial code:
public static String tidy(String s) {
String unicodeCharRegex = "\\\\u[A-Fa-f\\d]{4}\n";
if(s != null && !s.isEmpty()) {
Pattern p = Pattern.compile(unicodeCharRegex);
Matcher m = p.matcher(s);
while(m.find()) {
}
}
return s;
}
private String unicodeToString(String u) {
// TODO:
return "";
}