PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo Class

Definition

Information about a phone number.

public : sealed class PhoneNumberInfo : IStringable, IPhoneNumberInfopublic sealed class PhoneNumberInfo : IStringable, IPhoneNumberInfoPublic NotInheritable Class PhoneNumberInfo Implements IStringable, IPhoneNumberInfo// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Constructors

PhoneNumberInfo(String) PhoneNumberInfo(String) PhoneNumberInfo(String) PhoneNumberInfo(String)

Constructor.

public : PhoneNumberInfo(PlatForm::String number)public PhoneNumberInfo(String number)Public Sub New(number As String)// You can use this method in JavaScript.
Parameters
number
PlatForm::String String String String

A phone number that the created object will encapsulate.

Properties

CountryCode CountryCode CountryCode CountryCode

Gets the two-letter country code for this phone number.

public : int CountryCode { get; }public int CountryCode { get; }Public ReadOnly Property CountryCode As int// You can use this property in JavaScript.
Value
int int int int

A country code.

PhoneNumber PhoneNumber PhoneNumber PhoneNumber

Gets the phone number.

public : PlatForm::String PhoneNumber { get; }public string PhoneNumber { get; }Public ReadOnly Property PhoneNumber As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The phone number.

Methods

CheckNumberMatch(PhoneNumberInfo) CheckNumberMatch(PhoneNumberInfo) CheckNumberMatch(PhoneNumberInfo) CheckNumberMatch(PhoneNumberInfo)

Compares two PhoneNumberInfo objects.

public : PhoneNumberMatchResult CheckNumberMatch(PhoneNumberInfo otherNumber)public PhoneNumberMatchResult CheckNumberMatch(PhoneNumberInfo otherNumber)Public Function CheckNumberMatch(otherNumber As PhoneNumberInfo) As PhoneNumberMatchResult// You can use this method in JavaScript.
Parameters
otherNumber
PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo

The number to be compared to this object.

Returns

An enumeration value describing the result of the comparison.

GetGeographicRegionCode() GetGeographicRegionCode() GetGeographicRegionCode() GetGeographicRegionCode()

Gets the geographic region code for this number.

public : PlatForm::String GetGeographicRegionCode()public string GetGeographicRegionCode()Public Function GetGeographicRegionCode() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

A string representing the geographic region code.

GetLengthOfGeographicalAreaCode() GetLengthOfGeographicalAreaCode() GetLengthOfGeographicalAreaCode() GetLengthOfGeographicalAreaCode()

Gets the length in characters of the geographical area code.

public : int GetLengthOfGeographicalAreaCode()public int GetLengthOfGeographicalAreaCode()Public Function GetLengthOfGeographicalAreaCode() As int// You can use this method in JavaScript.
Returns
int int int int

Length, in characters, of the area code.

GetLengthOfNationalDestinationCode() GetLengthOfNationalDestinationCode() GetLengthOfNationalDestinationCode() GetLengthOfNationalDestinationCode()

Gets the length, in characters, of the national destination code.

public : int GetLengthOfNationalDestinationCode()public int GetLengthOfNationalDestinationCode()Public Function GetLengthOfNationalDestinationCode() As int// You can use this method in JavaScript.
Returns
int int int int

The length of the national destination code.

GetNationalSignificantNumber() GetNationalSignificantNumber() GetNationalSignificantNumber() GetNationalSignificantNumber()

Gets the national significant number of this object.

public : PlatForm::String GetNationalSignificantNumber()public string GetNationalSignificantNumber()Public Function GetNationalSignificantNumber() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

The national significant number.

PredictNumberKind() PredictNumberKind() PredictNumberKind() PredictNumberKind()

Heuristically predicts what kind of number is represented in this object.

public : PredictedPhoneNumberKind PredictNumberKind()public PredictedPhoneNumberKind PredictNumberKind()Public Function PredictNumberKind() As PredictedPhoneNumberKind// You can use this method in JavaScript.
Returns

An enumeration value describing the kind of phone number this object represents.

ToString() ToString() ToString() ToString()

Renders the phone number as a string.

public : PlatForm::String ToString()public string ToString()Public Function ToString() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

The number, rendered as a string.

TryParse(String, String, PhoneNumberInfo) TryParse(String, String, PhoneNumberInfo) TryParse(String, String, PhoneNumberInfo) TryParse(String, String, PhoneNumberInfo)

Static method that attempts to parse a given input string as a phone number (using a given region code) and creates a PhoneNumberInfo encapsulating it.

public : static PhoneNumberParseResult TryParse(PlatForm::String input, PlatForm::String regionCode, PhoneNumberInfo phoneNumber)public static PhoneNumberParseResult TryParse(String input, String regionCode, PhoneNumberInfo phoneNumber)Public Static Function TryParse(input As String, regionCode As String, phoneNumber As PhoneNumberInfo) As PhoneNumberParseResult// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

A phone number, in string form.

regionCode
PlatForm::String String String String

The two-letter region code to be used to parse input. Region codes should use upper-case letters.

phoneNumber
PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo

On success, this object encapsulates the given phone number.

Returns

An enumeration value giving details of the attempt to parse input.

See Also

TryParse(String, PhoneNumberInfo) TryParse(String, PhoneNumberInfo) TryParse(String, PhoneNumberInfo) TryParse(String, PhoneNumberInfo)

Static method that attempts to parse a given input string as a phone number, and creates a PhoneNumberInfo encapsulating it.

public : static PhoneNumberParseResult TryParse(PlatForm::String input, PhoneNumberInfo phoneNumber)public static PhoneNumberParseResult TryParse(String input, PhoneNumberInfo phoneNumber)Public Static Function TryParse(input As String, phoneNumber As PhoneNumberInfo) As PhoneNumberParseResult// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

A phone number, in string form.

phoneNumber
PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo PhoneNumberInfo

On success, this object encapsulates the given phone number.

Returns

An enumeration value giving details of the attempt to parse input.

See Also