I'd need to get the full country name from the country code. For example for Netherlands, I'd need the Netherlands
from the country code NL
.
I thought I could do that with Locale
like:
Locale loc = new Locale("NL"); loc.getCountry();
but loc.getCountry();
is empty.
Any idea about how to do this, please? Thanks in advance!
Member countries of the North American Numbering Plan (NANP) are assigned three-digit area codes under the common country prefix 1, shown in the format +1 XXX. +1 – United States, including United States territories: +1 340 – United States Virgin Islands.
The first method is using a free online tool called PhoneNum On the front page, you will find a text box into which you can enter the phone number whose origin you wish to determine. A bunch of information will be displayed to you, amongst which will be the country of origin of the phone number.
try like this
Locale loc = new Locale("","NL"); loc.getDisplayCountry();
Hope this will help out.
This should work:
Locale l = new Locale("", "NL"); String country = l.getDisplayCountry();
The first parameter of Locale is the language, which is not useful in your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With