PhoneFormatHelper Class
Namespace: PTS.Globalization
Assembly: PTS.Globalization.dll
Syntax
public static class PhoneFormatHelper
Inheritance
System.Object
PhoneFormatHelper
Methods
FormatPhoneNumber(String, CountryCode, Boolean)
Declaration
public static string FormatPhoneNumber(string input, CountryCode country, bool internationalFormat = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | |
CountryCode | country | |
System.Boolean | internationalFormat |
Returns
Type | Description |
---|---|
System.String |
IsValidPhoneNumber(String)
Determines whether phone number is valid international phone number.
Declaration
public static bool IsValidPhoneNumber(string phone)
Parameters
Type | Name | Description |
---|---|---|
System.String | phone | The phone number. |
Returns
Type | Description |
---|---|
System.Boolean |
IsValidPhoneNumber(String, CountryCode)
Determines whether phone number is valid for specific country.
Declaration
public static bool IsValidPhoneNumber(string phone, CountryCode country)
Parameters
Type | Name | Description |
---|---|---|
System.String | phone | The phone. |
CountryCode | country | The country. |
Returns
Type | Description |
---|---|
System.Boolean |
PhonePrefixToCountry(UInt16)
Declaration
public static CountryCode PhonePrefixToCountry(ushort prefix)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | prefix |
Returns
Type | Description |
---|---|
CountryCode |
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()