Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CompareInfo.GetCompareInfo Method (String, Assembly)

Initializes a new CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified Assembly.

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

public static CompareInfo GetCompareInfo(
	string name,
	Assembly assembly
)

Parameters

name
Type: System.String

A string representing the culture name.

assembly
Type: System.Reflection.Assembly

An Assembly that contains the string comparison methods to use.

Return Value

Type: System.Globalization.CompareInfo
A new CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current Assembly.

ExceptionCondition
ArgumentNullException

name is null.

-or-

assembly is null.

ArgumentException

name is an invalid culture name.

-or-

assembly is of an invalid type.

NoteNote

The behavior of this method is unpredictable. We recommend that you use a version of this method that does not take an assembly input.

The assembly parameter must be of the same type as Module.Assembly.

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