title: Twig - Trying to split an array element
body: <p>Im looping over an array of objects, and then trying to split one of the elements, in this case I want to split the postcode on the space. Ie. 'AB1 1AB' should just be 'AB1' . </p>
  
  <pre><code>{% for result in resultset %}
              {{ result.postcode|split(' ') }}
      {% endfor %}
  </code></pre>
  
  <p>Throws me an 'array to string error' </p>
  
  <p>Trying just:</p>
  
  <pre><code>{{ result.postcode[0] }}
  </code></pre>
  
  <p>Throws me a 'impossible to access key [0] on a string varaible' error.</p>
  
  <p>and just doing:</p>
  
  <pre><code>{{ result.postcode }}   
  </code></pre>
  
  <p>gives me no error, with the postcode displayed as <code>'AB1 1AB'</code></p>
  
  <p>Why does Twig think the string is an array when I try to split it?</p>