1

I have created a file for storing important data from my application , at the press of a button i want to clear data from that file without deleting it;I am using MODE_APPEND to append the data from my application.Please do suggest.

Kunal
  • 13
  • 3

1 Answers1

1

Try this

       PrintWriter writer = new PrintWriter(file);
       writer.print("");
       writer.close();

this will print empty string in the file

Toppers
  • 559
  • 3
  • 11