title: C# 3.5 partial class String IsNullOrWhiteSpace
body: <p>I'm trying to create extra functionality to the <code>String</code> class (<code>IsNullOrWhitespace</code> as in .NET4 )
  But I'm having an problem with referencing:</p>
  
  <blockquote>
    <p>Error 1   'String' is an ambiguous reference between 'string' and 'geolis_export.Classes.String'</p>
  </blockquote>
  
  <p>I don't want to create an extension method. Because this will crash if <code>string x = null;</code></p>
  
  <p>Usage:</p>
  
  <pre><code>private void tbCabineNum_PreviewTextInput(object sender, TextCompositionEventArgs e)
  {
      e.Handled = !e.Text.All(Char.IsNumber) || String.IsNullOrWhiteSpace(e.Text);
  }
  </code></pre>
  
  <p>String partial:</p>
  
  <pre><code>public partial class String
  {
      public static bool IsNullOrWhiteSpace(string value)
      {
          if (value == null) return true;
          return string.IsNullOrEmpty(value.Trim());
      }
  }
  </code></pre>
  
  <p>Is it not possible to create extras for the <code>String</code> class?
  I have tried to put the partial in the <code>System</code> namespace, but this gives other errors.</p>
  
  <p>Renaming <code>String</code> to <code>String2</code> fixes the problem also. But this is not what I want, because then there is no reference with the original <code>String</code> class.</p>