public static String hidePhone (Context context, String phone){
if (!TextUtils.isEmpty(phone) && phone.length() ==11) {
phone = phone.substring(0,3) +"****" + phone.substring(7,11);
}else{
Toast.makeText(context,"手机号格式不正确", Toast.LENGTH_SHORT).show();
}
return phone;
}
网友评论