开发者

How to compare phone numbers?

开发者 https://www.devze.com 2023-03-01 14:18 出处:网络
As PhoneNumberUtils is deprecated, How can we two phone numbers if they\'re identical enough for caller ID purposes. I mean different formats +44xxxxxxxxxx, 0xxxxxxxxxx开发者_StackOverflow社区 Use the

As PhoneNumberUtils is deprecated, How can we two phone numbers if they're identical enough for caller ID purposes. I mean different formats +44xxxxxxxxxx, 0xxxxxxxxxx开发者_StackOverflow社区


Use the PhoneNumberUtils.compare function doc: http://developer.android.com/reference/android/telephony/PhoneNumberUtils.html


reverse strings and compare only first 10 characters?


The best way would be for you to create a regular expression that would parse the actual phone number xxx-xxxx from any of it's prefixes (+xx, xxx).

0

精彩评论

暂无评论...
验证码 换一张
取 消