android手机号中间四位显示*号

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_34895720/article/details/102604337

public static String getStarMobile(String mobile) {

if (!TextUtils.isEmpty(mobile)) {

if (mobile.length() >=11)

return mobile.substring(0,3) +"****" + mobile.substring(7, mobile.length());

}else {

return "";

}

return mobile;

}

猜你喜欢

转载自blog.csdn.net/qq_34895720/article/details/102604337