Operators.CompareString Method (String, String, Boolean)

 

This API supports the product 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
)

Parameters

Left
Type: System.String

Required. Any String expression.

Right
Type: System.String

Required. Any String expression.

TextCompare
Type: System.Boolean

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

Return Value

Type: System.Int32

Value

Condition

-1

Left is less than Right.

0

Left is equal to Right.

1

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 statement.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone
Available since 8.1
Return to top
Show: