private static String decodeEmail (String email) {
List<Integer> codes = new ArrayList<Integer> ();
String parts [] = email.replace("&#x", "").split(";");
for (int i=0; i<parts.length; i++) {
codes.add(Integer.parseInt(parts[i],16));
}
String result = "";
for (int code : codes) {
String s = Character.toString((char)code);
result += s;
}
return result;
}
Exemplu:
List<Integer> codes = new ArrayList<Integer> ();
String parts [] = email.replace("&#x", "").split(";");
for (int i=0; i<parts.length; i++) {
codes.add(Integer.parseInt(parts[i],16));
}
String result = "";
for (int code : codes) {
String s = Character.toString((char)code);
result += s;
}
return result;
}
Exemplu:
- zhenya_ind@ukr.net
- zhenya_ind@ukr.net
Niciun comentariu:
Trimiteți un comentariu