Quantcast
Viewing all articles
Browse latest Browse all 20

Answer by Y2Kot for Read entire file in Scala?

You can use

Source.fromFile(fileName).getLines().mkString

however it should be noticed that getLines() removes all new line characters.If you want save formatting you should use

Source.fromFile(fileName).iter.mkString

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>