String.Compare Method

Compares two specified String objects with one another.

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

Syntax

[MethodImplAttribute]
public static int Compare (
         stringstrA,
         stringstrB
)

Parameters

  • strA
    The first String object you want to compare.
  • strB
    The second String object you want to compare.

Return Value

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

Value Meaning
Less than 0 (zero) strA is less than strB.
0 (zero) strA equals strB.
Greater than 0 (zero) strA is greater than strB.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

String Class
String Members
System Namespace