NullableTypes Class Library

NullableString.Compare Method (NullableString, NullableString)

Compares two specified NullableString structures.

[Visual Basic]
Overloads Public Shared Function Compare( _
   ByVal a As NullableString, _
   ByVal b As NullableString _
) As Integer
public static int Compare(
   NullableString a,
   NullableString b


A NullableString structure.
A NullableString structure.

Return Value

A 32-bit signed integer indicating the lexical relationship between the two comparands.

A negative integera is less than b.
Zeroa is equal to b.
A positive integera is greater than b.


b is Null.


By definition, any NullableString, including the Empty string, compares greater than a Null; and two Null compare equal to each other. This method performs a case-sensitive operation. The method uses the current culture to determine the ordering of individual characters. Uppercase letters evaluate greater than their lowercase equivalents. The two strings are compared on a character-by-character basis.

See Also

NullableString Class | NullableTypes Namespace | NullableString.Compare Overload List