StringComparer: Equals |
Compares two values for equality.
Public Function Equals( ByRef x As Variant, ByRef y As Variant ) As Boolean
When implementing this method, any custom logic should be applied to only type String. All other value types should be passed to the default comparer for consistent behavior.
The example is the implementation used by the StringComparer.Ordinal and StringComparer.OrdinalIgnoreCase implementation.
Private mStringComparison As StringComparison Private Function StringComparer_Equals(x As Variant, y As Variant) As Boolean If VarType(x) = vbString Then If VarType(y) = vbString Then StringComparer_Equals = CorString.Equals(x, y, mStringComparison) Exit Function End If End If StringComparer_Equals = Object.Equals(x, y) End Function