Syntax:
public int CompareTo(char value)
Parameters | Type | Meaning |
---|---|---|
value | System.Char | A Char object to compare. |
Return Value | Description |
---|---|
Less than zero | This instance precedes value. |
Zero | This instance has the same position in the sort order as value. |
Greater than zero | This instance follows value. |
using System;
class Sample
{
public static void Main()
{
char ch='A';
int result = ch.CompareTo('B');
Console.WriteLine(result);
}
}
The output:
-1
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |