Export (0) Print
Expand All

Operators.CompareString Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Performs binary or text string comparison when given two strings.

Namespace:  Microsoft.VisualBasic.CompilerServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public static int CompareString(
	string Left,
	string Right,
	bool TextCompare


Type: System.String

Required. Any String expression.

Type: System.String

Required. Any String expression.

Type: System.Boolean

Required. True to perform a case-insensitive string comparison; otherwise, False.

Return Value

Type: System.Int32




Left is less than Right.


Left is equal to Right.


Left is greater than Right.

This class supports the Visual Basic compiler and is not intended to be used directly from your code.

When the Visual Basic equality operator is used to compare two strings, it passes the strings to the CompareString method along with a value of False for the TextCompare argument. This performs a case-sensitive comparison that is either ordinal or based on the current culture, depending on the value of the Option Compare statement.

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft