title: Using StringFormat to format set of digits (not currency or number) from a string with C#
body: <p>I am working with WPF and C# and I want to format a set of digits (not currency or number) with <code>StringFormat</code> in a <code>TextBlock</code>.</p>
  
  <p>Example: <code>456321789</code> (string)</p>
  
  <p>And I want to show it in the <code>TextBlock</code> like <code>456 321 789</code>.</p>
  
  <p>This examples doesn't work:</p>
  
  <pre><code>&lt;TextBlock Text="{Binding Number, StringFormat=000 000 000"/&gt;
  
  &lt;TextBlock Text="{Binding Number, StringFormat=### ### ###"/&gt;
  
  &lt;TextBlock Text="{Binding Number, StringFormat={}{0:000 000 000}"/&gt;
  
  &lt;TextBlock Text="{Binding Number, StringFormat={}{0:### ### ###}"/&gt;
  </code></pre>
  
  <p>Sometime ago I tried to format a set of 7 digits like <code>5432-123</code>. And I wasn't successful.</p>
  
  <p>I tried many examples, and noting works with. What I am doing wrong?</p>
  
  <p>Note: The only way I can achieve this is if I have the set of digits as an integer. But I'd like to understand why I can't do it with a string.</p>
  
  <p>Thanks in advance!</p>