| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

Google的公共Java、C++和Javascript库用来解析,格式化,存储和验证国际电话号码:libphonenumber

libphonenumber是Google的公共Java、C++和Javascript库用来解析,格式化,存储和验证国际电话号码。 其中Java版本优化用于运行在智能手机上,并且用在了 Android framework 4.0 (Ice Cream Sandwich)以上的版本中。

功能亮点:

  • Parsing/formatting/validating phone numbers for all countries/regions of the world.
  • getNumberType - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
  • isNumberMatch - gets a confidence level on whether two numbers could be the same.
  • getExampleNumber/getExampleNumberByType - provides valid example numbers for all countries/regions, with the option of specifying which type of example phone number is needed.
  • isPossibleNumber - quickly guessing whether a number is a possible phonenumber by using only the length information, much faster than a full validation.
  • isValidNumber - full validation of a phone number for a region using length and prefix information.
  • AsYouTypeFormatter - formats phone numbers on-the-fly when users enter each digit.
  • findNumbers - finds numbers in text input.
  • PhoneNumberOfflineGeocoder - provides geographical information related to a phone number.
  • PhoneNumberToCarrierMapper - provides carrier information related to a phone number.

String swissNumberStr = "044 668 18 00"  PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();  try {    PhoneNumber swissNumberProto = phoneUtil.parse(swissNumberStr, "CH");  } catch (NumberParseException e) {    System.err.println("NumberParseException was thrown: " + e.toString());  }

项目主页:http://www.open-open.com/lib/view/home/1418785741652

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1418785741652.html
常用工具包 libphonenumber