title: split list by certain repeated index value
body: <p>I have a list of integers, in which some are consecutive numbers.</p>
  
  <p>What I have:</p>
  
  <p><code>myIntList = [21,22,23,24,0,1,2,3,0,1,2,3,4,5,6,7]</code> etc...</p>
  
  <p>What I want:</p>
  
  <pre><code>MyNewIntList = [[21,22,23,24],[0,1,2,3],[0,1,2,3,4,5,6,7]]
  </code></pre>
  
  <p>I want to be able to split this list by the element 0, i.e when looping, if the element is 0, to split the list into separate lists.
  Then, after splitting <code>myIntList</code> whatever number of times (based on the recurrences of finding the element 0), I want to append each 'split' or group of consecutive integers into a list within a list.</p>
  
  <p>Also would I be able to do the same sort of thing with a 'list of strings' instead of integers?  (Split the main string list into smaller lists based on a reoccurring element)</p>
  
  <p>EDIT: </p>
  
  <p>How would I go about splitting the list by consecutive numbers?  There's a part in my list where it jumps from 322 to 51, there is no 0 in between.  I want to split:</p>
  
  <pre><code>[[...319,320,321,322,51,52,53...]]
  </code></pre>
  
  <p>into</p>
  
  <pre><code>[[...319,320,321,322],[51,52,53...]]
  </code></pre>
  
  <p>basically, how do I split elements in a list by consecutive numbers?</p>
  
  <p>Posted here:
  <a href="https://stackoverflow.com/questions/34277467/split-list-of-integers-by-consecutive-order-into-separate-lists">Split list of lists (integers) by consecutive order into separate lists</a></p>