Code:
String text = "&<a href='/app/message?dpt=ma&ttp=msws&plf=news&pid=0408' style='color: #000000; font-size: 12px; font-family: Arial,Helvetica,sans-serif; border: 0; padding: 0; margin: 0 0 0 10px; text-decoration: underline;' title='Neue Nachrichten'>0</a>"; int pos = text.indexOf("&"); do { if (!text.substring(pos + 1, pos + 4).equalsIgnoreCase("amp")) { text = text.substring(0, pos + 1) + "amp;" + text.substring(pos + 1); } pos = text.indexOf("&", pos + 4); } while (pos < text.length() && pos != -1); System.out.println(text);
Comment