package com.fs.common.utils;


public class ParseUtils {

    public static String parsePhone(String phone) {
        if(StringUtils.isNotBlank(phone) && phone.trim().length() == 11) {
            return phone.trim().replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
        }
        return phone;

    }
    public static String parseAddress(String address) {

        if(address!=null){
            address=address.substring(0,address.length()/2)+"******";
            return address;
        }
        else return "";
    }
    public static String parseIdCard(String idcard) {
        if(idcard!=null){
            idcard=idcard.substring(0,idcard.length()/2)+"******";
            return idcard;
        }
        else return "";

    }
}
