I know about this
public static String stripAccents(String s) {
s = Normalizer.normalize(s, Normalizer.Form.NFD);
s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return s;
}
but it works not the way I want. It changes the sense of text
stripAccents("йод,ëлка,wäre") //иод,елка,ware
I want to delete only acute accents
stripAccents("café") //cafe
I know about this
public static String stripAccents(String s) {
s = Normalizer.normalize(s, Normalizer.Form.NFD);
s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return s;
}
but it works not the way I want. It changes the sense of text
stripAccents("йод,ëлка,wäre") //иод,елка,ware
I want to delete only acute accents
stripAccents("café") //cafe
I know about this
public static String stripAccents(String s) {
s = Normalizer.normalize(s, Normalizer.Form.NFD);
s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return s;
}
but it works not the way I want. It changes the sense of text
stripAccents("йод,ëлка,wäre") //иод,елка,ware
I want to delete only acute accents
stripAccents("café") //cafe
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.