Java tutorial
//package com.java2s; public class Main { public static String replaceHtmlChar(String str) { String htmlstring = str; htmlstring = htmlstring.replace("&", "&"); htmlstring = htmlstring.replace(" ", " "); htmlstring = htmlstring.replace("<", "<"); htmlstring = htmlstring.replace(">", ">"); return htmlstring; } }