retrography
6/21/2014 - 5:07 PM

The shortest way to read an entire text file into a string using Scala

The shortest way to read an entire text file into a string using Scala

object TextReader{
   def main(args: Array[String]) {
      val file = scala.io.Source.fromFile(args(0), "utf-8")
      val content = file.mkString
      file.close
      print(content)
   }
}