C# Guid CompareTo(Guid)
Description
Guid CompareTo(Guid)
compares this instance to a specified
Guid object and returns an indication of their relative values.
Syntax
Guid.CompareTo(Guid)
has the following syntax.
public int CompareTo(
Guid value
)
Parameters
Guid.CompareTo(Guid)
has the following parameters.
value
- An object to compare to this instance.
Returns
Guid.CompareTo(Guid)
method returns A signed number indicating the relative values of this instance and value.
Return value Description A negative integer This instance is less than value.
Zero This instance is equal to value. A positive integer This instance is
greater than value.
Example
The following example demonstrates CompareTo method.
/* w ww . j ava 2 s. c o m*/
using System;
class Sample
{
public static void Main()
{
Guid guidX = new Guid("{CA761232-ED42-11CE-BACD-00AA0057B223}");
Console.WriteLine(guidX.CompareTo(new Guid("{CA761232-ED42-11CE-BACD-00AA0057B224}")));
}
}
The code above generates the following result.