-1

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();

2 Answers2

0
var lines = File.ReadAllLines("E:\\lastname.txt");
File.WriteAllLines("E:\\lastname.txt", lines.Skip(1).ToArray());
Neel
  • 11,625
  • 3
  • 43
  • 61
0

This question is a duplicate of: Removing the first line of a text file in C#.

Please someone close this.

Community
  • 1
  • 1
piotrwest
  • 2,098
  • 23
  • 35