Here you can find the source of unescapeHTML(String source)
public static final String unescapeHTML(String source)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; public class Main { private static HashMap<String, String> htmlEntities; public static final String unescapeHTML(String source) { int i, j; boolean continueLoop; int skip = 0; do {//from ww w . j av a2 s .co m continueLoop = false; i = source.indexOf("&", skip); if (i > -1) { j = source.indexOf(";", i); if (j > i) { String entityToLookFor = source.substring(i, j + 1); String value = htmlEntities.get(entityToLookFor); if (value != null) { source = source.substring(0, i) + value + source.substring(j + 1); continueLoop = true; } else { skip = i + 1; continueLoop = true; } } } } while (continueLoop); return source; } }