Windows Dev Center

CultureInfo Constructor

Initializes a new instance of the CultureInfo class based on the culture specified by name.

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

public CultureInfo(
	string name
)

Parameters

name
Type: System.String
A predefined culture name, or the Name property of an existing CultureInfo object. name is not case-sensitive.

ExceptionCondition
ArgumentNullException

name is null.

CultureNotFoundException

On Windows systems, name is not a valid culture name.

For a list of predefined culture names, see the National Language Support (NLS) API Reference at the Go Global Developer Center.

If name is String.Empty, the constructor creates an instance of the invariant culture; this is equivalent to retrieving the value of the InvariantCulture property.

If name is not a valid culture name, the constructor throws a CultureNotFoundException.

If name is the name of the current system culture, the CultureInfo object instantiated by this method reflects any customizations that the user may have made to the system's culture information. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the user settings are incompatible with the culture associated with the CultureInfo object (for example, if the selected calendar is not a member of the current culture's OptionalCalendars array), the results of the methods and the values of the properties are undefined.

If the culture identifier associated with the specified culture name does not match the culture identifier of the current Windows culture, this constructor creates a CultureInfo object that uses information for the specified culture that is supplied by the operating system.

Version Notes

Windows Phone

 For unsupported cultures, the CultureInfo constructor throws a PlatformNotSupportedException exception instead of an ArgumentException exception.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft