strip Tags from HTML or XML - Android android.text

Android examples for android.text:Html

Description

strip Tags from HTML or XML

Demo Code

import android.text.Html;
import android.text.TextUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Pattern;

public class Main{

    public static String stripTags(String text) {
        return text.replaceAll("<[^>]+>|<[^>]+/>", ""); //$NON-NLS-1$ //$NON-NLS-2$
    }/*from   w  w w .j a  va  2s. c  o  m*/

}

Related Tutorials