using System;
class Program
{
static void Main()
{
string a = "a"; // 1
string b = "b"; // 2
int c = 0;
// When a is SMALLER than b
c = a.CompareTo(b);
Console.WriteLine(c);
// -1
// When b is BIGGER than a
c = b.CompareTo(a);
Console.WriteLine(c);
// 1
}
}
Thursday, April 2, 2009
incomparably simple compare to example because I can never remember
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment