NullableTypes Class Library

NullableString.Compare Method (NullableString, NullableString, Boolean)

Compares two specified NullableString structures, ignoring or honoring their case.

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


A NullableString structure.
A NullableString structure.
A Boolean indicating a case-sensitive or insensitive comparison. (true indicates a case-insensitive comparison).

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. The two strings are compared on a character-by-character basis.

See Also

NullableString Class | NullableTypes Namespace | NullableString.Compare Overload List