I am saving data to a file-name using Stream writer but if i run the code for second time the same data is appended to the previous data but i would like to clear the old data a
You're passing true as the append parameter in the StringWriter constructor.
true
append
StringWriter