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
[C#]
public static int Compare(
   NullableString a,
   NullableString b,
   bool ignoreCase
);

Parameters

a
A NullableString structure.
b
A NullableString structure.
ignoreCase
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.

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

-or-

b is Null.

Remarks

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