- Code: Select all
using (var write = new StreamWriter())
{
write.WriteLine();
}
How would you make it remove a line..?
using (var write = new StreamWriter())
{
write.WriteLine();
}
using(var sr = new StreamReader("path/path.txt"))
using(var sw = new StreamWriter("path/path1.txt"))
{
string line;
while((line=sr.ReadLine())!=null)
{
if(!line.Contains("stuff in bad line"))
{
sw.WriteLine(line);
}
}
}
File.Delete("path/path.txt");
File.Move("path/path1.txt","path/path.txt");
using System.IO;
Users browsing this forum: No registered users and 3 guests