CompareInfo.ToString 方法

定义

返回表示当前 CompareInfo 对象的字符串。Returns a string that represents the current CompareInfo object.

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

返回

表示当前 CompareInfo 对象的字符串。A string that represents the current CompareInfo object.

注解

此方法将重写 Object.ToString 方法。This method overrides the Object.ToString method. 它将返回一个字符串,其中包含类名称和实例 Name 属性的值,由连字符分隔。It returns a string that consists of the class name and the value of the instance Name property, separated by a hyphen.

调用方说明

从 .NET Framework 4 开始,ToString() 方法返回类名,后跟空格、连字符、空格和 Name 属性的值。Staring with the .NET Framework 4, the ToString() method returns the class name followed by a space, a hyphen, a space, and the value of the Name property. 例如,对于表示 en-US 区域性的 CompareInfo 对象,ToString() 方法返回“CompareInfo - en-US”。For example, for a CompareInfo object that represents the en-US culture, the ToString() method returns "CompareInfo - en-US". 在 .NET Framework 的早期版本中,它返回后跟空格、连字符、空格和 LCID 属性的值的类名。In previous versions of the .NET Framework, it returns the class name followed by a space, a hyphen, a space, and the value of the LCID property. 例如,对于表示 en-US 区域性的 CompareInfo 对象,ToString() 方法返回“CompareInfo - 1033”。For example, for a CompareInfo object that represents the en-US culture, the ToString() method returns "CompareInfo - 1033".

适用于

另请参阅