title: Best practices for serializing objects to a custom string format for use in an output file
body: <p>I was just about to implement an override of ToString() on a particular business class in order to produce an Excel-friendly format to write to an output file, which will be picked up later and processed. Here's what the data is supposed to look like:</p>
  
  <pre><code>5555555 "LASTN SR, FIRSTN"  5555555555  13956 STREET RD     TOWNSVILLE  MI  48890   25.88   01-003-06-0934
  </code></pre>
  
  <p>It's no big deal for me to just make a format string and override <code>ToString()</code>, but that will change the behavior of <code>ToString()</code> for any objects I decide to serialize this way, making the implementation of <code>ToString()</code> all ragged across the library.</p>
  
  <p>Now, I've been reading up on <a href="http://msdn.microsoft.com/en-us/library/system.iformatprovider.aspx" rel="noreferrer">IFormatProvider</a>, and a class implementing it sounds like a good idea, but I'm still a little confused about where all this logic should reside and how to build the formatter class.</p>
  
  <p>What do you guys do when you need to make a CSV, tab-delimited or some other non-XML arbitrary string out of an object?</p>