public static String mobileEncrypt(String mobile){
if(TextUtils.isEmpty(mobile) || (mobile.length() != 11)){
return mobile;
}
return mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
}

public static String idEncrypt(String id){
if(TextUtils.isEmpty(id) || (id.length() < 8)){
return id;
}
return id.replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*");
}

相关文章:

  • 2021-11-17
  • 2021-06-29
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案