title: Scala: Split array into chunks by some logic
body: <p>Is there some predefined function in Scala to split list into several lists by some logic? I found  <code>grouped</code> method, but it doesn't fit my needs.  </p>
  
  <p>For example, I have List of strings: <code>List("questions", "tags", "users", "badges", "unanswered")</code>. </p>
  
  <p>And I want to split this  list by max length of strings (for example 12). In other words in each resulting chunk sum of the length of all strings should not be more than 12: </p>
  
  <pre><code>List("questions"), List("tags", "users"), List("badges"), List("unanswered")
  </code></pre>
  
  <p>EDIT: I'm not necessarily need to find the most optimal way of combining strings into chunks, just linear loop which checks next string in list, and if its length doesn't fit to required (12) then return current chunk and next string will belong to next chunk</p>