CompareInfo::ToString Method

Returns a string that represents the current CompareInfo object.

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

public:
virtual String^ ToString() override

Return Value

Type: System::String
A string that represents the current CompareInfo object.

This method overrides the Object::ToString method. It returns a string that consists of the class name and the value of the instance Name property, separated by a hyphen.

Notes to Callers

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. For example, for a CompareInfo object that represents the en-US culture, the ToString method returns "CompareInfo - en-US". 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. For example, for a CompareInfo object that represents the en-US culture, the ToString method returns "CompareInfo - 1033".

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft