title: Splitting a list into two lists in scala
body: <p>I have a list containing something like:</p>
  
  <pre><code>val lines: List[String] = List("bla blub -- id_1", "sdkfjdf -- id_2", "blubber blab -- id_1", "foo -- id_3", "ieriuer -- id_2", "bar -- id_3")
  </code></pre>
  
  <p>So basically the list contains an identifier which exists exactly twice (id_x) and a string which belongs to one of the identifiers.</p>
  
  <p>I want to split that one list into two lists which then each contains a unique set of id_s with their belonging strings, like this:</p>
  
  <pre><code>l1("bla blub -- id_1", "sdkfjdf -- id_2", "foo -- id_3") 
  l2("blubber blab -- id_1", "ieriuer -- id_2", "bar -- id_3")
  </code></pre>
  
  <p>How would i do that in a functional way?</p>
  
  <p>Best Regards,
  Sven</p>