Here you can find the source of htmldecode(String str)
public static String htmldecode(String str)
//package com.java2s; public class Main { public static String htmldecode(String str) { if (str == null) { return null; }/*w ww.j av a2 s . co m*/ return replace(""", "\"", replace("<", "<", str)); } public static String replace(String from, String to, String source) { if (source == null || source.length() == 0 || from == null || from.length() == 0 || to == null) { return source; } StringBuffer str = new StringBuffer(""); int index = -1; int len = from.length(); while ((index = source.indexOf(from)) != -1) { str.append(source.substring(0, index) + to); source = source.substring(index + len); } str.append(source); return str.toString(); } }