In short, you can’t. There are several phone number length specifications around the world, and lack of country code can make its resolution dubious.
For example, US follows the North American Numbering Plan, whose format is as follows:
+1 (NPA) NXX-xxxx
Where:
- 1 – US international Country Calling code
- NPA – Numbering Plan Area Code
- NXX – Central Office (exchange) code
- xxxx – Subscriber Number
Several countries follow the same pattern, and using the same codes for different specifications – for example, the NPA-equivalent field in Brazilian numbering plan relates to state/city, while the NXX-equivalent may have anything between 3 and 5(!) numbers. So, let’s assume this valid Brazilian number:
(15) 93935-5555
and this US number (This NPA doesn’t exist, just fyi):
[+1]-(593) 935-5555
So, not only you can’t because patterns overlap, but also if you’re not sure you have the full number it may resolve to the wrong country.
1
solved c# system to display country names without receiving country codes on the phone [closed]