title: Split an Arraylist
body: <p>Background information: I'm iterating through a site collection, which stores all the sites I'm looking for in the correct hierarchical order. When I try to display this information in a nested format, in addition to multiple columns on the same row format is where I run into the problem.</p>
  
  <p>I have a for loop that adds items to an ArrayList. I have another for loop that iterates through the "example" ArrayList. I need to break or split this ArrayList each time "-----" occurs. Problem is ArrayList does not support .Split(), so I'm out of ideas. My overall goal is to display the information in the ArrayList in nested dynamic-columns that are based on the number of "-----".</p>
  
  <pre><code>ArrayList example = new ArrayList();
  example.Add("Door");
  example.Add("A1"); //nested
  example.Add("A2"); //nested
  example.Add("-----");
  example.Add("House");
  example.Add("A1"); //nested
  example.Add("A2"); //nested
  example.Add("-----");
  example.Add("Fence");
  example.Add("A1"); //nested
  example.Add("A2"); //nested
  example.Add("-----");
  </code></pre>
  
  <p>When I iterate through the list a table is built and displayed like the example below:</p>
  
  <pre>
  |Door| A1 | A2 | House | A1 | A2 | Fence | A1 | A2| 
  </pre>
  
  <p>However, I need the data in the table to be displayed like this example below:</p>
  
  <pre><code>|Door| House | Fence| &lt;----This is the desired output that I'm trying to achieve.
  |A1  | A1    | A1   | &lt;----This is the desired output that I'm trying to achieve.
  |A2  | A2    | A2   | &lt;----This is the desired output that I'm trying to achieve.
  </code></pre>
  
  <p>Any help would be appreciated.</p>