toCountryCodeAlpha2

fun toCountryCodeAlpha2(context: Context, alpha3CountryCode: String): String?

Convert from an ISO 3166 Alpha-3 country code to an ISO 3166 Alpha-2 country code. For example "USA" -> "US"

Return

The ISO 3166 Alpha-2 country code or null if it could not be converted

Parameters

context

Context needed to read resource files

alpha3CountryCode

Tthe ISO 3166 Alpha-3 country code to convert