Commit 979e976e authored by 董建华's avatar 董建华

手机号长度判断

parent 6726bf85
...@@ -111,9 +111,13 @@ public class AddressFilter { ...@@ -111,9 +111,13 @@ public class AddressFilter {
if( null == phone){ if( null == phone){
return null; return null;
} }
String phonePre = phone;
if(phone.length()>3){
phonePre = phone.substring(0, 3);
}
Set<Map.Entry<List<String>, String>> entries = OPERATO_MAP.entrySet(); Set<Map.Entry<List<String>, String>> entries = OPERATO_MAP.entrySet();
for (Map.Entry<List<String>, String> entry : entries) { for (Map.Entry<List<String>, String> entry : entries) {
boolean contains = entry.getKey().contains(phone.substring(0, 3)); boolean contains = entry.getKey().contains(phonePre);
if(contains){ if(contains){
return phone.concat(entry.getValue()); return phone.concat(entry.getValue());
} }
...@@ -137,8 +141,4 @@ public class AddressFilter { ...@@ -137,8 +141,4 @@ public class AddressFilter {
private String replaceMent; private String replaceMent;
} }
public static void main(String[] args) {
String email = getEmail("18518759303", "啊412763575@qq.com董建华");
System.out.println(email);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment