Here you can find the source of unescapeHTML(String comment)
public static String unescapeHTML(String comment)
//package com.java2s; /*//w ww . ja va2 s . c o m * M2M ServiceFOTA ONM version 1.0 * * Copyright ? 2014 kt corp. All rights reserved. * * This is a proprietary software of kt corp, and you may not use this file except in * compliance with license agreement with kt corp. Any redistribution or use of this * software, with or without modification shall be strictly prohibited without prior written * approval of kt corp, and the copyright notice above does not evidence any actual or * intended publication of such software. */ public class Main { public static String unescapeHTML(String comment) { int length = comment.length(); StringBuffer buffer = new StringBuffer(); for (int i = 0; i < length; ++i) { String comp = comment.substring(i, i + 1); if (" ".compareTo(comp) == 0) { comp = comment.substring(++i, i + 1); buffer.append(" "); } else if ("\r".compareTo(comp) == 0) { comp = comment.substring(++i, i + 1); if ("\n".compareTo(comp) == 0) buffer.append("<BR>\r"); else buffer.append("\r"); } else if (",".compareTo(comp) == 0) { comp = comment.substring(++i, i + 1); buffer.append(" "); } else if ("\n".compareTo(comp) == 0) { buffer.append("<BR>\r"); } buffer.append(comp); } return buffer.toString(); } }