title: C# String Operator Overloading
body: <p>G'Day Mates - </p>
  
  <p>What is the right way (excluding the argument of whether it is advisable) to overload the string operators &lt;, >, &lt;= and >= ?</p>
  
  <p>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.</p>
  
  <pre><code>namespace System
  {
     public partial class String
     {
         public static Boolean operator &lt;(String a, String b)
         {
             return a.CompareTo(b) &lt; 0;
         }
  
         public static Boolean operator &gt;(String a, String b)
         {
             return a.CompareTo(b) &gt; 0;
         }
     }
  </code></pre>
  
  <p>}</p>