StrComp Function

Language Items List

Definition:

Compares two strings and returns an Integer or Long that indicates the result of the comparison.

Syntax:

StrComp(strexpr1, strexpr2 [,compare])


Syntax Description


strexpr1 Any string expression.

strexpr2 Any string expression.

compare An optional argument that specifies the string-comparison method. Compare can be a value of 0 or 1. If compare is not used, the default string-comparison method is used, which is case-sensitive

A value of 0, makes string comparison case-sensitive, meaning that
T is less than t. A value of 1, makes string comparison case-insensitive, meaning that T matches T.

Details:

The StrComp function returns one of the following values as a result of the comparison:


Condition Return value


strexpr1 < strexpr2 -1

strexpr1 = strexpr2 0

strexpr1 > strexpr2 1

This value indicates the relationship between the string expressions.

See Also:

InStr Function