Scala: write string to file in one statement

后端 未结 14 1218
星月不相逢
星月不相逢 2020-11-29 17:31

For reading files in Scala, there is

Source.fromFile(\"file.txt\").mkString

Is there an equivalent and concise way to write a string to fi

14条回答
  •  旧时难觅i
    2020-11-29 18:00

    You can easily use Apache File Utils. Look at function writeStringToFile. We use this library in our projects.

提交回复
热议问题