package com.house365.ws.util;

import org.apache.http.util.TextUtils;

public class MobileUtil {
    /**
     * 隐藏手机号4-7位
     * 不足7位不处理
     * @param phone
     * @return
     */
    public static String hidePhone(String phone) {
        if(TextUtils.isEmpty(phone) || phone.length() < 7) return phone;

        return phone.substring(0,3) + "****" + phone.substring(7);
    }

    public static void main(String[] args) {
        String p = "1234567";
        System.out.println(hidePhone(p));
    }
}
