
Operators.CompareString Method (String, String, Boolean)
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
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.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
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.Int32Value | 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.
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