StrCompare function (LotusScript® Language)
Compares two strings and returns the result.
Syntax
StrCompare ( string1 , string2 [ , compMethod ] )
StrComp is acceptable in place of StrCompare.
Elements
string1
Any String expression.
string2
Any String expression.
compMethod
A number designating the comparison method.
Number |
Comparison method |
---|---|
0 |
Case Sensitive, Pitch sensitive |
1 |
Case Insensitive, Pitch sensitive |
4 |
Case Sensitive, Pitch insensitive |
5 |
Case Insensitive, Pitch insensitive |
Use 2 to specify string comparison in the platform's collation sequence. If 2 is specified, strings are compared bit-wise. If you omit compMethod, the default comparison mode is the mode set by the Option Compare statement for this module. If there is no statement for the module, the default is case-sensitive and pitch-sensitive.
Return value
The following table shows what StrCompare returns, depending on the relationship between the strings being compared.
Strings being compared |
StrCompare result |
---|---|
Either string is NULL |
NULL |
string1 is less than string2 |
-1 |
string1 equals string2 |
0 |
string1 is greater than string2 |
1 |