Convert html string To String - Android android.text

Android examples for android.text:Html

Description

Convert html string To String

Demo Code

import android.text.Html;
import android.text.Spanned;

public class Main{

    /**/*  w  ww .  j a v a  2 s.c  o  m*/
     * Html to string.
     * 
     * @param html
     *            the html
     * @return the string
     */
    public static String htmlToString(String html) {

        return Html.fromHtml(
                html.replaceAll("\\<.*?\\>", "").replaceAll("\n", "")
                        .replaceAll("\t", " ")).toString();
    }

}

Related Tutorials