textbox4.Text already show .txt file 1st word.
Now I need how going delete 1st word from .txt file?
my code
StreamReader objstream = new StreamReader("E:\\lastname.txt");
textBox4.Text = objstream.ReadLine();
textbox4.Text already show .txt file 1st word.
Now I need how going delete 1st word from .txt file?
my code
StreamReader objstream = new StreamReader("E:\\lastname.txt");
textBox4.Text = objstream.ReadLine();
var lines = File.ReadAllLines("E:\\lastname.txt");
File.WriteAllLines("E:\\lastname.txt", lines.Skip(1).ToArray());
This question is a duplicate of: Removing the first line of a text file in C#.
Please someone close this.