0

在 Java 和 Scala 控制台中,以下代码有效:

scala> print("hello\r"); print("world")
world
scala> print("hello world\r"); print("world")
world world
scala> 

在 Scala 的增压弟弟,菊石壳中,也毫不奇怪:

Welcome to the Ammonite Repl 2.2.0 (Scala 2.13.3 Java 1.8.0_271)
ben-tmp@ print("hello!\r"); print("dear") 
dearo!

ben-tmp@

编译和运行的同一行代码在 Kojo 中不起作用。字符串连接到行尾。这是一个错误,还是我错过了什么?

4

0 回答 0