New line character in Scala

后端 未结 6 1974
既然无缘
既然无缘 2021-01-01 13:08

Is there a shorthand for a new line character in Scala? In Java (on Windows) I usually just use \"\\n\", but that doesn\'t seem to work in Scala - specifically



        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-01 13:30

    Try this interesting construction :)

    import scala.compat.Platform.EOL
    println("aaa"+EOL+"bbb")
    

提交回复
热议问题