I have StringBuilder sb and I want that string save as *.txt file. Problem is that I get \"filename.txt\" but it is completely empty,
StringBuilder sb
*.txt
\"filename.txt\"
Either create your PrintWriter with this constructor, changing the first argument to an OutputStream:
PrintWriter
OutputStream
out = new PrintWriter(new FileOutputStream("filename.txt"), true);
to turn on auto flushing, or, just close the writer once you're done writing to it with out.close().
out.close()