mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Source.fromPath no longer exists (https://github.com/scala/scala/blob/master/src/library/scala/io/Source.scala) Changed example to use Source.fromFile
This commit is contained in:
parent
37299ff4da
commit
c0a9eabb6c
@ -396,7 +396,7 @@ object Application {
|
||||
|
||||
// To read a file line by line
|
||||
import scala.io.Source
|
||||
for(line <- Source.fromPath("myfile.txt").getLines())
|
||||
for(line <- Source.fromFile("myfile.txt").getLines())
|
||||
println(line)
|
||||
|
||||
// To write a file use Java's PrintWriter
|
||||
|
Loading…
Reference in New Issue
Block a user