G'Day Mates -
What is the right way (excluding the argument of whether it is advisable) to overload the string operators <, >, <= and >= ?
I've tried it five ways to Sunday and I get various errors - my best shot was declaring a partial class and overloading from there, but it won't work for some reason.
namespace System
{
public partial class String
{
public static Boolean operator <(String a, String b)
{
return a.CompareTo(b) < 0;
}
public static Boolean operator >(String a, String b)
{
return a.CompareTo(b) > 0;
}
}
}