Iso3166FromPhoneCode Method

Looks up the country represents by its phone code

Definition

Namespace: MobileTrack.Common.Models
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public static Iso3166Country? FromPhoneCode(
	string phoneCode
)

Parameters

phoneCode  String
The national phone code (or one of its phone codes)

Return Value

Iso3166Country
The country representing the phoneCode

Remarks

It grabs the longest dial code it can find; this is because of North America's 1, which is also used in other countries, so in those cases we apply the region code to the nation code; If, therefore, we get multiple results, the longest one is the correct one.

Exceptions

InvalidOperationExceptionNo element satisfies the condition in phoneCode

See Also