title: Split and append a string?
body: <p>Right now I take in a string like this <code>"112233 112233 112233 112233"</code>, and I split it into an array like this:</p>
  
  <pre><code>string text = ProcessString("112233 112233");
  string[] dates = text.Split(' ');
  </code></pre>
  
  <p>And that works great, but I want to use string builder to build my string so they would end up like <code>11-22-33 11-22-33</code> etc.</p>
  
  <p>So I did try this:</p>
  
  <pre><code>static string ProcessString(string input)
  {
      StringBuilder buffer = new StringBuilder(input.Length * 3 / 2);
  
      for (int i = 0; i &lt; input.Length; i++)
      {
          if ((i &gt; 0) &amp; (i % 2 == 0))
              buffer.Append("-");
          buffer.Append(input[i]);
      }
      return buffer.ToString();
  }
  </code></pre>
  
  <p>It works, but it does not match the expected output of:
  </p>
  
  <pre><code>11-22-33 
  11-22-33
  </code></pre>
  
  <p>My current output is:
  </p>
  
  <pre><code>11-22-33- 
  1-12-23-3
  -11-22-33
  </code></pre>
  
  <p>What can I do to fix this?</p>