In python this works:
clear = lambda: os.system('cls')
clear()
How would I do that in scala?
Using REPL started from a bash shell:
scala> import scala.sys.process._
import scala.sys.process._
scala> def clear() = "clear".!
clear: ()Int
scala> clear()
How about print("\u001b[2J")
?
use this code.
print("\033c")
this removes all charset
it will clear away everything in the Scala REPL.