Here you can find the source of htmlToText(String sHTML)
public static String htmlToText(String sHTML)
//package com.java2s; //License from project: Open Source License public class Main { public static String htmlToText(String sHTML) { String sText = ""; if (sHTML != null) { int i = 0; while (i < sHTML.length()) { char c = sHTML.charAt(i); switch (c) { case '<': i++;/*from ww w. j ava 2s . c o m*/ int iEndTag = sHTML.indexOf(">", i); String sTagName = sHTML.substring(i, iEndTag); if (!sTagName.startsWith("/")) { } i = iEndTag + 1; break; //case '\'' | '\"': // sText += "\\"+c; // i++; // break; default: sText += c; i++; break; } } } return sText; } }