---
title: variantCode
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nslocale/variantcode
---

# variantCode

The variant code for the locale.

## Declaration

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

## Discussion

Discussion Examples of variant code include "POSIX" and "PREEURO". Use localizedString(forVariantCode:) 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 variantCode key.

## See Also

### Getting Information About a Locale

- [localeIdentifier](foundation/nslocale/localeidentifier.md)
- [countryCode](foundation/nslocale/countrycode.md)
- [languageCode](foundation/nslocale/languagecode.md)
- [scriptCode](foundation/nslocale/scriptcode.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)
