CKTIS / C#
RegionInfo — region and ISO currency code
RegionInfo in System.Globalization exposes information about a country or region. Its RegionInfo.ISOCurrencySymbol property returns a three-letter ISO 4217 currency code, such as USD, rather than a currency sign such as $.
Version: .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
Syntax
using System.Globalization;
RegionInfo region = new RegionInfo("en-US");
string currencyCode = region.ISOCurrencySymbol;RegionInfo in System.Globalization describes a country or region. It is not equivalent to CultureInfo: it does not represent user preferences. The class is available in .NET 10; the usage shown does not require preview language features.
The constructor new RegionInfo("en-US") accepts a specific culture name. You can also pass a region code such as "US", but the documentation recommends a specific culture because some names and symbols depend on the language or script.
RegionInfo.ISOCurrencySymbol is a read-only string property returning a three-letter ISO 4217 code, such as USD. Do not confuse it with CurrencySymbol, which exposes a currency sign such as $, or with an ISO 3166 country code. The example explicitly selects "en-US" instead of relying on current culture settings.
For user input, account for constructor errors: null causes ArgumentNullException, while an invalid name or a neutral culture such as "en" causes ArgumentException. A neutral culture name that matches a region code is interpreted as a region. In globalization-invariant mode, if PredefinedCulturesOnly is set to false, the constructor can accept "en-US" and create the object using invariant culture data. In that case, ISOCurrencySymbol may not return USD. The example requires globalization data for the region to produce the shown result.
Examples
using System;
using System.Globalization;
RegionInfo region = new RegionInfo("en-US");
Console.WriteLine(region.ISOCurrencySymbol);Result
USD
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.