Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextUtils;

public class Main {

    public static String removeHtml(String htmlStr) {
        if (TextUtils.isEmpty(htmlStr)) {
            return "";
        }
        String html = htmlStr;
        html = html.replaceAll("<(.*?)\\>", " ");//Removes all items in brackets
        html = html.replaceAll("<(.*?)\\\n", " ");//Must be undeneath
        html = html.replaceFirst("(.*?)\\>", " ");//Removes any connected item to the last bracket
        html = html.replaceAll("&nbsp;", " ");
        html = html.replaceAll("&amp;", "&");
        html = html.replaceAll("&lt;", "<");
        html = html.replaceAll("&gt;", ">");
        html = html.replaceAll("&nbsp;", " ");
        return html;
    }

    public static boolean isEmpty(String input) {
        if (input == null || "null".equals(input) || TextUtils.isEmpty(input))
            return true;
        return false;
    }
}