PhoneNumberUtils.AreSamePhoneNumber(String, String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines if two phone numbers are the same.
[Android.Runtime.Register("areSamePhoneNumber", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z", "", ApiSince=31)]
public static bool AreSamePhoneNumber (string number1, string number2, string defaultCountryIso);
[<Android.Runtime.Register("areSamePhoneNumber", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z", "", ApiSince=31)>]
static member AreSamePhoneNumber : string * string * string -> bool
Parameters
- number1
- String
number1
- number2
- String
number2
- defaultCountryIso
- String
The lowercase two letter ISO 3166-1 country code. Used when parsing
the phone numbers where it is not possible to determine the country
associated with a phone number based on the number alone. It
is recommended to pass in
TelephonyManager#getNetworkCountryIso()
.
Returns
True if the two given phone number are same.
- Attributes
Remarks
Determines if two phone numbers are the same.
Matching is based on libphonenumber. Unlike #compare(String, String)
, matching takes into account national dialing plans rather than simply matching the last 7 digits of the two phone numbers. As a result, it is expected that some numbers which would match using the previous method will no longer match using this new approach.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.