asp.net.ph

String.CompareTo Method ( String )

System Namespace   String Class


Compares this instance with a specified String object.

[ VB ]
<Serializable>
Overloads Public Function CompareTo ( _
   ByVal strB As String _
) As Integer

[ C# ]
[ Serializable ]
public int CompareTo (
   string strB
);

[ C++ ]
[ Serializable ]
public: int CompareTo (
   String* strB
);

[ JScript ]
public Serializable
function CompareTo (
   strB : String
) : int;

Parameters

strB
A String.

Return Value

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

Value Condition
Less than zero This instance is less than value.
Zero This instance is equal to value.
Greater than zero This instance is greater than value.

-or-

value is a null reference ( Nothing in Visual Basic ).


Remarks

By definition, any String, including the empty string, compares greater than a null reference; and two null references compare equal to each other.

See Also

String Members   String.CompareTo Overload List   Compare   CompareOrdinal Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph