Here you can find the source of htmlcodeToSpecialchars(String str)
public static String htmlcodeToSpecialchars(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String htmlcodeToSpecialchars(String str) { str = str.replaceAll("&", "&"); str = str.replaceAll(""", "\""); str = str.replaceAll("'", "'"); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); return str; }//from w w w. j a va2s. co m }