G\'Day Mates -
What is the right way (excluding the argument of whether it is advisable) to overload the string operators <, >, <= and >= ?
I\'ve trie
You can't have a partial class for string, because the string class itself is not partial and hence won't work with your partial class.
String is sealed, so you can inherit from it and then overload the operator.
In short, alas, you can't do what you with to do.
Not know what you're trying to do exactly, I can't suggest a good alternative. But, take a look at extension methods, which are often good for situations. Leaving aside whether you should :), you could add to the string class a method called IsGreaterThan and return true or false however you wish. This is good because you can give the extension method a name that makes it's meaning clear, keeps the existing operators in tact (which you have no choice about anyway), and allows for quick/simple code.