Share via


String.CompareTo Method (Object)

Compares the current String object with a specified Object object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

[MethodImplAttribute]
public int CompareTo (
         Objectvalue
)

Parameters

Return Value

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

Value Meaning
Less than 0 (zero) this is less than value.
0 (zero) this equals value.
Greater than 0 (zero) this is greater than value.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

String Class
String Members
System Namespace