Android HTML to Text Convert HtmlToText(String str)

Here you can find the source of HtmlToText(String str)

Description

Html To Text

Declaration

public static String HtmlToText(String str) 

Method Source Code

//package com.java2s;

public class Main {
    public static String HtmlToText(String str) {
        str = str.replace("<br />", "\n");
        str = str.replace("<br/>", "\n");
        str = str.replace("&nbsp;&nbsp;", "\t");
        str = str.replace("&nbsp;", " ");
        str = str.replace("&#39;", "\\");
        str = str.replace("&quot;", "\\");
        str = str.replace("&gt;", ">");
        str = str.replace("&lt;", "<");
        str = str.replace("&amp;", "&");

        return str;
    }/*from w ww  . jav a  2s  .com*/
}