Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

scala.io.Source.fromFile

  • Loading branch information...
commit 081b7cde7dfd9c425c367482f05594723a527b8c 1 parent 867e01f
@rightgo09 authored
Showing with 8 additions and 0 deletions.
  1. +6 −0 03-03/TextCounter020.scala
  2. +2 −0  03-03/data.txt
View
6 03-03/TextCounter020.scala
@@ -0,0 +1,6 @@
+val filename = args(0)
+val src = scala.io.Source.fromFile(filename) // オブジェクトを取得
+val lines = src.getLines
+for (line <- lines) {
+ println(line)
+}
View
2  03-03/data.txt
@@ -0,0 +1,2 @@
+Hello Wolrd
+Scala Programming Sample
Please sign in to comment.
Something went wrong with that request. Please try again.