title: Is there a way to convert C-format strings for C# -format strings in C#/.NET 2.0?
body: <p>So i would like to convert string like this:</p>
  
  <pre><code>"Bloke %s drank %5.2f litres of booze and ate %d bananas"
  </code></pre>
  
  <p>with a C# equivalent for .Format or .AppendFormat methods</p>
  
  <pre><code>"Bloke {0} drank {1,5:f2} litres of booze and ate {2} bananas"
  </code></pre>
  
  <p>sorry but i'm not sure if the C# version was correct but u got the idea. The solution does not have to be perfect but cover the basic case.</p>
  
  <p>Thanks &amp; BR -Matti</p>
  
  <p>answered in my other question <a href="https://stackoverflow.com/questions/4098533/how-to-write-c-regular-expression-pattern-to-match-basic-printf-format-strings-l">How to write C# regular expression pattern to match basic printf format-strings like &quot;%5.2f&quot;?</a></p>