Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CultureInfo.CompareInfo Property

Gets the CompareInfo that defines how to compare strings for the culture.

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

abstract CompareInfo : CompareInfo with get 
override CompareInfo : CompareInfo with get

Property Value

Type: System.Globalization.CompareInfo
The CompareInfo that defines how to compare strings for the culture.

The CompareInfo property returns a CompareInfo object that provides culture-specific information used in culture-sensitive sorting and string comparison operations.

The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. 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 UseUserOverride is true and the specified culture matches the current culture of Windows, the CultureInfo uses those overrides, including user settings for the properties of the DateTimeFormatInfo instance returned by the DateTimeFormat property, and the properties of the NumberFormatInfo instance returned by the NumberFormat property. If the user settings are incompatible with the culture associated with the CultureInfo, for example, if the selected calendar is not one of the OptionalCalendars, the results of the methods and the values of the properties are undefined.

The following code example shows how to create a CultureInfo for Spanish (Spain) with the international sort and another CultureInfo with the traditional sort.

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

.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
Show:
© 2015 Microsoft