How to Write String to File in Scala

Write String to File in Scala

In this example, we will show simple example about, How to write string to file in scala. The program has been tested and shared in the post.

Example Code

Output

Enter the Content
This is Dinesh Krishnan
The content has been written to file successfully…