I want to get country codes from a list of locale. e.g. I have inputs: en_US, dua_CM, zh-Hans_MO ... I want to output corresponding country code: US, CM, MO... (I am not sure if country code is the last two characters of locale...)
I tried the following Java code, but it printed out null.
Locale lc = new Locale("en_US");
System.out.print(lc.getCountry());
Any suggestions? Thanks in advance!
Dan