I need to delete an exact line from a text file but I cannot for the life of me workout how to go about doing this.
Any suggestions or examples would be greatly appr
One way to do it if the file is not very big is to load all the lines into an array:
string[] lines = File.ReadAllLines("filename.txt"); string[] newLines = RemoveUnnecessaryLine(lines); File.WriteAllLines("filename.txt", newLines);