Clearing content of text file using C# February 16, 2023 by Tarik File.WriteAllText(path, String.Empty); Alternatively, File.Create(path).Close();