Santhosh Shettigar Santhosh Shettigar - 7 months ago 48
Android Question

How to delete only the content of a file in java?

May i please know how can i delete the content of the file in java?
Thanks in advance.

Answer

How about this:

new RandomAccessFile(fileName).setLength(0);