Skip to main content
The PhoneFormatter class contains various methods used to format phone numbers.

GetInternationalNumber

The GetInternationalNumber method returns the international number of the specified phone number. The following example specifies a country ID and a local number and then formats the local number into an international number.

GetBaseNumber

GetBaseNumber is another useful method in the phone formatter class. The example specifies the country ID and the phone number to format. The method formats to the normal phone number format of the specified country. The method removes the additional numbers and characters, and then return the base number as a string.

GetGSMNumber

This method returns the GSM compliant phone number formatted according to the country specified. Additionally, the method resolves the letters in the number. The V is resolved to 8, according to the standard phone key-pad, and so on.

GetLongDisplayNumber

This method is designed to format a number to the long country number format. Here the number will be formatted to the long phone number format of Norway. The method adds the country code to the phone number.

GetPrefix

The above method is a very simple method designed to return the country prefix of the specified country as a string. Here we retrieve the country prefix of Norway.

ResolveAlphanumericNumber

This method is designed to resolve the alpha-numeric characters in a number. Here the number will get resolved according to the standard key-pad of a phone.