title: Is there a cleaner / more efficient way of splitting strings for use in a gridview?
body: <p>I basically have an entity that gets bound to my gridview and has a string value like this: 'data1|data2|data3|data4'.</p>
  
  <p>Is there a more efficient or better way of doing this than the method I am currently using below?</p>
  
  <pre><code>&lt;asp:Repeater runat="server" ID="rptCentres"&gt;
  &lt;ItemTemplate&gt;
      &lt;h2&gt;&lt;%#Eval("Centre.Name") %&gt; ( &lt;%#Eval("Entities.Count") %&gt; )&lt;/h2&gt;
      &lt;asp:GridView runat="server" ID="dgShotlist" AutoGenerateColumns="false"&gt;
          &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
              &lt;itemtemplate&gt;
                  &lt;p&gt;&lt;%#Eval("ImageContainer.Title").ToString().Split('|')[0]%&gt;&lt;/p&gt;
              &lt;/itemtemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;itemtemplate&gt;
                  &lt;p&gt;&lt;%#Eval("ImageContainer.Title").ToString().Split('|')[1]%&gt;&lt;/p&gt;
              &lt;/itemtemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;itemtemplate&gt;
                  &lt;p&gt;&lt;%#Eval("ImageContainer.Title").ToString().Split('|')[2]%&gt;&lt;/p&gt;
              &lt;/itemtemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;itemtemplate&gt;
                  &lt;p&gt;&lt;%#Eval("ImageContainer.Title").ToString().Split('|')[3]%&gt;&lt;/p&gt;
              &lt;/itemtemplate&gt;
          &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>