title: What is the difference between toString and mkString in scala?
body: <p>I have a file that contains 10 lines - I want to retrieve it, and then split them with a newline("\n") delimiter. </p>
  
  <p>here's what I did</p>
  
  <pre><code>val data = io.Source.fromFile("file.txt").toString;
  </code></pre>
  
  <p>But this causes an error when I try to split the file on newlines. </p>
  
  <p>I then tried</p>
  
  <pre><code>val data = io.Source.fromFile("file.txt").mkString;
  </code></pre>
  
  <p>And it worked.</p>
  
  <p>What the heck? Can someone tell me what the difference between the two methods are?</p>