Java code for converting country code alpha-2 (in) to alpha 3 (ind)
•
Java
Using Java, is there a quick way to convert alpha-2 country codes (in or GB)
I can get alpha-2 Code:
String[] codes = java. util. Locale. getISOLanguages();
This is not a problem. In fact, my application reads alpha - 2 code, but I need to output alpha - 3 equivalent
Is there a similar way to the Alpha-3 code obtained above?
Any suggestions?
Solution
This job –
Locale locale = new Locale("en","IN"); System.out.println("Country=" + locale.getISO3Country());
Output:
Country=IND
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码