Commit 9fdb5c4a22e3ee811583dede3202172ddc0c43c7
1 parent
f9d63e7f50
Exists in
master
and in
8 other branches
座机号 替换的问题
Showing 1 changed file with 10 additions and 1 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java
View file @
9fdb5c4
| ... | ... | @@ -120,9 +120,18 @@ |
| 120 | 120 | |
| 121 | 121 | return new String(res); |
| 122 | 122 | |
| 123 | + }else{ | |
| 124 | + for (int i = 0; i < chars.length; i++) { | |
| 125 | + if (2 < i && i < chars.length-2) { | |
| 126 | + res[i] = '*'; | |
| 127 | + } else { | |
| 128 | + res[i] = chars[i]; | |
| 129 | + } | |
| 130 | + } | |
| 131 | + return new String(res); | |
| 123 | 132 | } |
| 124 | 133 | } |
| 125 | - return ""; | |
| 134 | + return phone; | |
| 126 | 135 | } |
| 127 | 136 | |
| 128 | 137 | public static Date getBirthDay(String idCard){ |