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 getHideMobile(String mobile) {
        if (TextUtils.isEmpty(mobile)) {
            return "";
        }
        if (mobile.length() <= 3) {
            return mobile;
        }
        String str = mobile.substring(0, 3);
        for (int i = 3; i < mobile.length(); i++) {
            str += "X";
        }
        return str;
    }
}