title: Kotlin how to split a list in to sublists
body: <p>I would like to split a list into a few sublists, but I have no idea how to do it.
  Once of my ideas was splitting the list by index of element. For exmaple "B" index is 0, "S" index 2, so I would like to take a part between index 0 - 1 into the first sublist, then the second sublist should be the part between index 2 - 5.
  Example of my list:</p>
  
  <pre><code>val listOfObj = listOf("B", "B" , "S", "B", "B", "X", "S", "B", "B", "P")
  </code></pre>
  
  <p>Result after splitting:</p>
  
  <pre><code>listOf(listOf("B","B"), listOf("S", "B", "B", "X"), listOf("S", "B", "B", "P") )
  </code></pre>
  
  <p>How do I achieve such a result?</p>