Class E164PhoneNumber
- Namespace
- NuvTools.Security.Verification
- Assembly
- NuvTools.Security.dll
Phone numbers in E.164 form: a plus sign, the country calling code and the national number, digits
only, at most 15 of them (+5511987654321).
public static class E164PhoneNumber
- Inheritance
-
E164PhoneNumber
- Inherited Members
Methods
IsValid(string?)
Whether the value is already a number in E.164 form.
public static bool IsValid(string? value)
Parameters
valuestringThe value to check.
Returns
TryNormalize(string?, string, out string)
Turns a number as a person types it into E.164 form.
public static bool TryNormalize(string? input, string defaultCountryCallingCode, out string phoneNumber)
Parameters
inputstringWhat was typed: spaces, dots, dashes and parentheses are ignored. A leading
+or00means the country calling code is included; otherwise the number is national.defaultCountryCallingCodestringThe country calling code of a national number, digits only (
55for Brazil,1for the United States). A national number's leading trunk zero is dropped.phoneNumberstringThe number in E.164 form, when the input is one.
Returns
- bool
Whether the input is a phone number.