Table of Contents

Interface IPhoneNumberRules

Namespace
HeroKit.Globalization
Assembly
HeroKit.dll

Phone number rules of a country.

public interface IPhoneNumberRules
Extension Methods

Methods

Format(string?)

Formats a phone number in the national notation of the country.

string? Format(string? value)

Parameters

value string

The phone number in any common notation.

Returns

string

The formatted number, or null if the value is not valid.

IsMobile(string?)

Checks whether a value is a valid mobile phone number of the country.

bool IsMobile(string? value)

Parameters

value string

The phone number in any common notation.

Returns

bool

True if valid and mobile; otherwise false.

IsValid(string?)

Checks whether a value is a valid phone number of the country.

bool IsValid(string? value)

Parameters

value string

The phone number in any common notation.

Returns

bool

True if valid; otherwise false.

ToE164(string?)

Converts a phone number to E.164, for example "+905321234567".

string? ToE164(string? value)

Parameters

value string

The phone number in any common notation.

Returns

string

The E.164 form, or null if the value is not valid.