How can I save a string in a text file?
If you're simply outputting text, rather than any binary data, the following will work:
Then, write your String to it, just like you would to any output stream:
need exception handling, as ever. Be sure to call
when you've finished writing.
Edit: further simplified per Jonik's comments.