---
title: countryCode
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nslocale/countrycode
---

# countryCode

The country or region code for the locale.

## Declaration

```swift
var countryCode: String? { get }
```

## Discussion

Discussion Examples of country or region codes include "GB", "FR", and "HK". Use localizedString(forCountryCode:) to obtain a version of the value suitable for display to the user. This property contains the same value returned by the object(forKey:) method when passing the countryCode key.

## See Also

### Related Documentation

- [isoCountryCodes](foundation/nslocale/isocountrycodes.md)

### Getting Information About a Locale

- [localeIdentifier](foundation/nslocale/localeidentifier.md)
- [languageCode](foundation/nslocale/languagecode.md)
- [scriptCode](foundation/nslocale/scriptcode.md)
- [variantCode](foundation/nslocale/variantcode.md)
- [exemplarCharacterSet](foundation/nslocale/exemplarcharacterset.md)
- [collationIdentifier](foundation/nslocale/collationidentifier.md)
- [collatorIdentifier](foundation/nslocale/collatoridentifier.md)
- [usesMetricSystem](foundation/nslocale/usesmetricsystem.md)
- [decimalSeparator](foundation/nslocale/decimalseparator.md)
- [groupingSeparator](foundation/nslocale/groupingseparator.md)
- [currencyCode](foundation/nslocale/currencycode.md)
- [currencySymbol](foundation/nslocale/currencysymbol.md)
- [calendarIdentifier](foundation/nslocale/calendaridentifier.md)
- [quotationBeginDelimiter](foundation/nslocale/quotationbegindelimiter.md)
- [quotationEndDelimiter](foundation/nslocale/quotationenddelimiter.md)
