All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.skype.CountryIsoByCountryName Maven / Gradle / Ivy

The newest version!
package com.skype;

import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;

public class CountryIsoByCountryName {
	private static Map countryIsoByCountryName = new LinkedHashMap();
	static {
		String[] isoCountries = Locale.getISOCountries();
    	for (String countryIso : isoCountries) {
			String displayCountry = new Locale("", countryIso).getDisplayCountry(new Locale("en_US"));
			countryIsoByCountryName.put(displayCountry.toLowerCase(), countryIso.toLowerCase());
		}
	}
	
	public static String getIsoForCountry(String country) {
		return countryIsoByCountryName.get(country.toLowerCase());
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy