CorString: Compare

Compare

Compares two specified String objects using the specified rules, and returns an integer that indicates their relative position in the sort order.



 Public Function Compare(
	  ByRef StrA As String,
	  ByRef StrB As String,
	  Optional ByVal ComparisonType As StringComparison = StringComparison. Ordinal ) As Long

Parameters

StrA
[ByRef] String. The first string to compare.
StrB
[ByRef] String. The second string to compare.
ComparisonType
[ByVal] Optional. StringComparison. One of the enumeration values that specifies the rules to use in the comparison.  

Default: StringComparison . Ordinal

Return Values

Long -  A 32-bit signed integer that indicates the lexical relationship between the two comparands, as shown in the following table
Value Condition
Less than zeroStrA is less than StrB.
ZeroStrA equals StrB.
Greater than zeroStrA is greater than StrB.

See Also

Project CorLib Overview

Class CorString Overview