title: Split list when predicate is true
body: <p>Does Kotlin provide a mutation function to split a list when a specific predicate is true?</p>
  <p>In the following example the list should be split when the element is a <code>.</code>.
  The result should be of the type <code>List&lt;List&lt;String&gt;&gt;</code>.</p>
  <pre><code>// input list
  val list = listOf(
      &quot;This is&quot;, &quot;the&quot;, &quot;first sentence&quot;, &quot;.&quot;,
      &quot;And&quot;, &quot;now there is&quot;, &quot;a second&quot;, &quot;one&quot;, &quot;.&quot;,
      &quot;Nice&quot;, &quot;.&quot;
  )
  
  // the following should be the result of the transformation
  listOf(
      listOf(&quot;This is&quot;, &quot;the&quot;, &quot;first sentence&quot;),
      listOf(&quot;And&quot;, &quot;now there is&quot;, &quot;a second&quot;, &quot;one&quot;),
      listOf(&quot;Nice&quot;)
  )
  </code></pre>
  <p>I need something like <code>list.splitWhen { it == &quot;.&quot; }</code></p>