Udostępnij za pośrednictwem


PhoneNumberInfo.TryParse Method

Definition

Overloads

TryParse(String, PhoneNumberInfo)

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

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.

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, [Out] PhoneNumberInfo ^ & phoneNumber);
/// [Windows.Foundation.Metadata.Overload("TryParse")]
 static PhoneNumberParseResult TryParse(winrt::hstring const& input, [Out] PhoneNumberInfo const& & phoneNumber);
[Windows.Foundation.Metadata.Overload("TryParse")]
public static PhoneNumberParseResult TryParse(string input, out PhoneNumberInfo phoneNumber);
Public Shared Function TryParse (input As String, ByRef phoneNumber As PhoneNumberInfo) As PhoneNumberParseResult

Parameters

input
String

Platform::String

winrt::hstring

A phone number, in string form.

phoneNumber
PhoneNumberInfo

On success, this object encapsulates the given phone number.

Returns

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

Attributes

See also

Applies to

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, [Out] PhoneNumberInfo ^ & phoneNumber);
/// [Windows.Foundation.Metadata.Overload("TryParseWithRegion")]
 static PhoneNumberParseResult TryParse(winrt::hstring const& input, winrt::hstring const& regionCode, [Out] PhoneNumberInfo const& & phoneNumber);
[Windows.Foundation.Metadata.Overload("TryParseWithRegion")]
public static PhoneNumberParseResult TryParse(string input, string regionCode, out PhoneNumberInfo phoneNumber);
Public Shared Function TryParse (input As String, regionCode As String, ByRef phoneNumber As PhoneNumberInfo) As PhoneNumberParseResult

Parameters

input
String

Platform::String

winrt::hstring

A phone number, in string form.

regionCode
String

Platform::String

winrt::hstring

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

phoneNumber
PhoneNumberInfo

On success, this object encapsulates the given phone number.

Returns

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

Attributes

See also

Applies to