How to read from standard input line by line?

后端 未结 6 583
走了就别回头了
走了就别回头了 2020-12-22 17:19

What\'s the Scala recipe for reading line by line from the standard input ? Something like the equivalent java code :

import java.util.Scanner; 

public cla         


        
6条回答
  •  一向
    一向 (楼主)
    2020-12-22 17:43

    Can you not use

    var userinput = readInt // for integers
    var userinput = readLine 
    ...
    

    As available here : Scaladoc API

提交回复
热议问题