Advertisement
Spectrewiz

A way to easily delete a line in a txt file.

Feb 16th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.18 KB | None | 0 0
  1. //A way to easily delete a line in a txt file.
  2. var file = new List<string>(System.IO.File.ReadAllLines("C:\\path"));
  3. file.RemoveAt(12);
  4. File.WriteAllLines("C:\\path", file.ToArray());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement