CultureInfo.ToString 方法

定义

返回一个字符串,该字符串包含当前 CultureInfo 的名称,其格式为 languagecode2-country/regioncode2。Returns a string containing the name of the current CultureInfo in the format languagecode2-country/regioncode2.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

包含当前 CultureInfo 名称的字符串。A string containing the name of the current CultureInfo.

注解

此方法重写 Object.ToStringThis method overrides Object.ToString. 它将返回传递到 CultureInfo(String)CultureInfo(String, Boolean) 构造函数或 CreateSpecificCultureGetCultureInfo(String) 方法的区域性名称的规范化版本。It returns a normalized version of the culture name that is passed to the CultureInfo(String) or CultureInfo(String, Boolean) constructor or to the CreateSpecificCulture or GetCultureInfo(String) method. 它通过将为 languagecode2中的字符转换为小写并将国家/regioncode2中的字符转换为大写(如有必要),对结果字符串进行规范化。It normalizes the result string by converting characters in languagecode2 to lowercase and converting characters in country/regioncode2 to uppercase if necessary.

Windows 系统上的预定义区域性名称列在windows 支持的语言/区域名称列表中的 "语言标记" 列中。Predefined culture names on Windows systems are listed in the Language tag column in the list of language/region names supported by Windows. 列名遵循 BCP 47 定义的标准。Culture names follow the standard defined by BCP 47.

适用于

另请参阅