Search code examples
c#windows-store-appsstoragefile

Windows Store App how to delete text from file


In a windows store app, how can I delete text from a file ? For example

If I have

StorageFile file = await roamingfolder.CreateFileAsync(filename,
    CreationCollisionOption.OpenIfExists);
await FileIO.AppendTextAsync(file, temp);

How can i remove some text from this file ?


Solution

  • You generally read the text into a string, remove the text, and rewrite the file.