remove All Tag Html - Android java.lang

Android examples for java.lang:String HTML

Description

remove All Tag Html

Demo Code

import android.content.Context;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Random;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{

    /**/* ww w .  j a  v a  2 s . c o  m*/
     * 
     * @param html
     * @return
     */
    public static String removeAllTagHtml(String html) {
        Pattern tags = Pattern.compile("</?[^>]+>");
        Matcher match = tags.matcher(html); // here you specify the string you
        // want to modify (HTML)
        String result = match.replaceAll("");
        return result;
    }

}

Related Tutorials