PhoneNumberFormatter PhoneNumberFormatter PhoneNumberFormatter PhoneNumberFormatter PhoneNumberFormatter Class

Definition

Formats phone numbers.

public : sealed class PhoneNumberFormatter
struct winrt::Windows::Globalization::PhoneNumberFormatting::PhoneNumberFormatter
public sealed class PhoneNumberFormatter
Public NotInheritable Class PhoneNumberFormatter
var phoneNumberFormatter = new phoneNumberFormatter();
Attributes

Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Constructors

PhoneNumberFormatter() PhoneNumberFormatter() PhoneNumberFormatter() PhoneNumberFormatter() PhoneNumberFormatter()

Creates a PhoneNumberFormatter object, using the current default region.

Methods

Format(PhoneNumberInfo) Format(PhoneNumberInfo) Format(PhoneNumberInfo) Format(PhoneNumberInfo) Format(PhoneNumberInfo)

Returns a string representation of the provided phone number.

Format(PhoneNumberInfo, PhoneNumberFormat) Format(PhoneNumberInfo, PhoneNumberFormat) Format(PhoneNumberInfo, PhoneNumberFormat) Format(PhoneNumberInfo, PhoneNumberFormat) Format(PhoneNumberInfo, PhoneNumberFormat)

Returns a string representing the given phone number, using the given format.

FormatPartialString(String) FormatPartialString(String) FormatPartialString(String) FormatPartialString(String) FormatPartialString(String)

Returns a string representing the formatted partial phone number given.

Use this method to format phone numbers as they are being entered by a user, to help the user visualize the complete, formatted number.

FormatString(String) FormatString(String) FormatString(String) FormatString(String) FormatString(String)

Returns the input string, formatted as a phone number.

FormatStringWithLeftToRightMarkers(String) FormatStringWithLeftToRightMarkers(String) FormatStringWithLeftToRightMarkers(String) FormatStringWithLeftToRightMarkers(String) FormatStringWithLeftToRightMarkers(String)

Returns the input string, formatted as a phone number, surrounded by Unicode Left to Right (LTR) markers.

GetCountryCodeForRegion(String) GetCountryCodeForRegion(String) GetCountryCodeForRegion(String) GetCountryCodeForRegion(String) GetCountryCodeForRegion(String)

Static method that returns the country code for a given region code.

GetNationalDirectDialingPrefixForRegion(String, Boolean) GetNationalDirectDialingPrefixForRegion(String, Boolean) GetNationalDirectDialingPrefixForRegion(String, Boolean) GetNationalDirectDialingPrefixForRegion(String, Boolean) GetNationalDirectDialingPrefixForRegion(String, Boolean)

Static method that returns the national direct dialing prefix for the given region.

TryCreate(String, PhoneNumberFormatter) TryCreate(String, PhoneNumberFormatter) TryCreate(String, PhoneNumberFormatter) TryCreate(String, PhoneNumberFormatter) TryCreate(String, PhoneNumberFormatter)

Attempts to create a PhoneNumberFormatter for a given region code, and doesn't throw on failure.

WrapWithLeftToRightMarkers(String) WrapWithLeftToRightMarkers(String) WrapWithLeftToRightMarkers(String) WrapWithLeftToRightMarkers(String) WrapWithLeftToRightMarkers(String)

Wraps a string with Unicode Left to Right (LTR) markers.