private static String ReplceSpecialChars(String s) { String orig=s; Pattern pnum=Pattern.compile("&#([0-9]+);"); Matcher m=pnum.matcher(s); while(m.find()) { int t=Integer.parseInt(m.group(1)); char ch=(char)t; orig=orig.replaceFirst(m.group(0), ""+ch); } return orig; } CàT will be parsed to CàT CàáT , will be CàáT
Post a Comment
No comments:
Post a Comment