VBScript StrComp
Function
The StrComp function compares two strings and returns a value that represents the result of the comparison.
The StrComp function can return the following values:
-1 (if string1 < string2)
0 (if string1 = string2)
1 (if string1 > string2)
Null (if string1 or string2 is Null)
Syntax
Parameter | Description |
---|---|
string1 | Required. A string expression. |
string2 | Required. A string expression. |
compare | Optional. Specifies the type of string comparison to use. The default is 0. Possible values are: 0 = vbBinaryCompare - Performs a binary comparison<br> 1 = vbTextCompare - Performs a text comparison |