Table of Contents

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

value string

The value to check.

Returns

bool

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

input string

What was typed: spaces, dots, dashes and parentheses are ignored. A leading + or 00 means the country calling code is included; otherwise the number is national.

defaultCountryCallingCode string

The country calling code of a national number, digits only (55 for Brazil, 1 for the United States). A national number's leading trunk zero is dropped.

phoneNumber string

The number in E.164 form, when the input is one.

Returns

bool

Whether the input is a phone number.