Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * decode the string to <, >, </ * @param text * @return */ public static String decodeString(String text) { String ret = null; ret = text.replaceAll("<", "<"); ret = ret.replaceAll(">", ">"); ret = ret.replaceAll("'", "'"); ret = ret.replaceAll(""", "\""); ret = ret.replaceAll("&", "&"); return ret; } }