TelPhoneUtils.java 534 B

123456789101112131415161718192021222324
  1. package com.zhongzheng.common.utils;
  2. import com.zhongzheng.common.utils.spring.SpringUtils;
  3. import org.springframework.context.MessageSource;
  4. import org.springframework.context.i18n.LocaleContextHolder;
  5. /**
  6. * 手机号码工具栏
  7. *
  8. * @author hjl
  9. */
  10. public class TelPhoneUtils
  11. {
  12. /**
  13. * 隐藏手机号码
  14. * @param tel
  15. * @return
  16. */
  17. public static String hideTelPhone(String tel)
  18. {
  19. String phoneNumber = tel.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
  20. return phoneNumber;
  21. }
  22. }