Created
February 17, 2018 10:06
-
-
Save YordanGeorgiev/fd8ef36204fb09ceebdfa6c67bd0ca60 to your computer and use it in GitHub Desktop.
[foreach loop with var] how-to assign a var into scala foreach loop #scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// how-to assign var in foreach loop | |
val objFileHandler = new FileHandler () | |
objFileHandler.getFileTree( new File ( dataCsvDir ) ) | |
.filter(_.getName.endsWith(".csv")) | |
.foreach{ | |
x => { | |
var f = x; | |
println ( f.toString() ) | |
/* some operation */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment