mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-10 00:36:48 +02:00
Merge pull request #468 from cengizIO/master
[scala/en] Source.fromPath no longer exists
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user