RegionInfo Constructor (Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the RegionInfo class based on the country/region associated with the specified culture identifier.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

new : 
        culture:int -> RegionInfo

Parameters

culture
Type: System.Int32

A culture identifier.

Exception Condition
ArgumentException

culture specifies either an invariant, custom, or neutral culture.

RegionInfo(String) is the recommended constructor for instantiating a RegionInfo object. Unlike the RegionInfo(Int32) constructor that requires a numeric culture identifier as a parameter, its parameter is a more readable culture name or country code.

The culture identifier is mapped to the corresponding National Language Support (NLS) locale identifier. Detailed culture information appears in the National Language Support (NLS) API Reference at the Go Global Developer Center.

The value of the Name property of the new RegionInfo object instantiated by calling this constructor is the ISO 3166 2-letter code for the country/region, not the combined language and country/region code. For example, if a RegionInfo object is instantiated with the culture identifier 0x0409 for the English (United States) culture, the value of the Name property is "US". In contrast, if a RegionInfo object is instantiated with the combined language and country/region code en-US for the English (United States) culture, the value of the Name property is "en-US".

The following code example compares two instances of RegionInfo that were created differently.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: