0
我是Scala的新手。我想向現有文件添加一行新的文本。在scala中爲現有文件添加一行新文本
我曾嘗試下面的代碼,但它覆蓋現有的文本:
println("plese enter the text")
val text = Console.readLine()
val write = new PrintWriter(new File("Test.txt"))
write.write(text)
write.close()
請幫助我。
工作對我來說..你可以粘貼整個代碼嗎? –
謝謝AJay,它的工作正常。 –
http://stackoverflow.com/questions/34649989/how-to-parse-json-with-lift-json-in-scala –