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 highlightText(String html, String name, String text) {
        if (TextUtils.isEmpty(text)) {
            return name;
        }

        if (name.contains(text)) {
            String replaceHtml = html.replace("%s", text);
            name = name.replaceAll(text, replaceHtml);
        }

        return name;
    }

    public static boolean isEmpty(String str) {
        return TextUtils.isEmpty(str) || str.equals("null");
    }
}