Android HTML Element Remove RemoveImgTag(String html)

Here you can find the source of RemoveImgTag(String html)

Description

Remove Img Tag

Declaration

public static String RemoveImgTag(String html) 

Method Source Code

//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    static final Pattern patternImg = Pattern
            .compile("<img(.+?)src=\"(.+?)\"(.+?)(onload=\"(.+?)\")?([^\"]+?)>");

    public static String RemoveImgTag(String html) {
        Matcher m = patternImg.matcher(html);
        while (m.find()) {
            html = m.replaceAll("");
        }//from   w w  w .  ja va2  s .c o m
        return html;
    }
}

Related

  1. RemoveHtmlTag(String html)
  2. RemoveVideoTag(String html)
  3. removeHtml(String text)
  4. delHTMLTag(String htmlStr)