java判断该手机号码是否是移动手机号段

王朝学院·作者佚名  2009-04-24
窄屏简体版  字體: |||超大  

/**

* 判断该手机号码是否是移动手机号段<br>

*

* @param phone

* @return true or false

* @throws Exception

*/

private boolean isMobileNumber(String phone) throws ServiceException {

boolean isExist = false;

phone = phone.trim();

if (phone == null || phone.length() < 7) {

try {

throw new Exception("wrong phone length");

} catch (Exception ex) {

ex.printStackTrace();

}

}

String code = phone.substring(0, 7);// 暂时保留2009-01-16 16:30

if (code.startsWith("134") || code.startsWith("135")

|| code.startsWith("136") || code.startsWith("137")

|| code.startsWith("138") || code.startsWith("139")

|| code.startsWith("159") || code.startsWith("158")

|| code.startsWith("150") || code.startsWith("157")

|| code.startsWith("151") || code.startsWith("188")

|| code.startsWith("189")) {

isExist = true;

}

return isExist;

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航