Java code for converting country code alpha-2 (in) to alpha 3 (ind)

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
分享
二维码
< <上一篇
下一篇>>