Operators.CompareString(String, String, Boolean) Method  
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Performs binary or text string comparison when given two strings.
This API supports the product infrastructure and is not intended to be used directly from your code.
public:
 static int CompareString(System::String ^ Left, System::String ^ Right, bool TextCompare);public static int CompareString(string Left, string Right, bool TextCompare);public static int CompareString(string? Left, string? Right, bool TextCompare);static member CompareString : string * string * bool -> intPublic Shared Function CompareString (Left As String, Right As String, TextCompare As Boolean) As IntegerParameters
- Left
- String
Required. Any String expression.
- Right
- String
Required. Any String expression.
- TextCompare
- Boolean
Required. True to perform a case-insensitive string comparison; otherwise, False.
Returns
| Value | Condition | 
|---|---|
| -1 | Leftis less thanRight. | 
| 0 | Leftis equal toRight. | 
| 1 | Leftis greater thanRight. | 
Remarks
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.