title: Using .NET string formatting, how do I format a string to display blank (empty string) for zero (0)?
body: <p>I am using a DataBinder.Eval expression in an ASP.NET Datagrid, but I think this question applies to String formatting in .NET in general.  The customer has requested that if the value of a string is 0, it should not be displayed.  I have the following hack to accomplish this:</p>
  
  <pre><code>&lt;%# IIf(DataBinder.Eval(Container.DataItem, "MSDWhole").Trim = "0", "", 
      DataBinder.Eval(Container.DataItem, "MSDWhole", "{0:N0}"))  %&gt;
  </code></pre>
  
  <p>I would like to change the <code>{0:N0}</code> formatting expression so that I can eliminate the IIf statement, but can't find anything that works.</p>