title: Fastest way to insert these dashes in python string?
body: <p>So I know Python strings are immutable, but I have a string:</p>
  
  <pre><code>c['date'] = "20110104"
  </code></pre>
  
  <p>Which I would like to convert to</p>
  
  <pre><code>c['date'] = "2011-01-04"
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>c['date'] = c['date'][0:4] + "-" + c['date'][4:6] + "-" + c['date'][6:]
  </code></pre>
  
  <p>Seems a bit convoluted, no? Would it be best to save it as a separate variable and then do the same? Or would there basically be no difference?</p>