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.
Asked
Active
Viewed 104 times
1 Answers
1
Try this
PrintWriter writer = new PrintWriter(file);
writer.print("");
writer.close();
this will print empty string in the file

Toppers
- 559
- 3
- 11