Stealthminer Posted August 19, 2010 Posted August 19, 2010 Hello all i need little help. I Want to delete a line in txt file with C# Like ; When i type "google" in textbox and press delete button my program deletes "google" line in txt. is it possible ? Thanks for your help. Quote
Leaders snarfblam Posted August 19, 2010 Leaders Posted August 19, 2010 I get the general idea of what you are trying to do, but it's not clear exactly what you mean. You ask about a text file but give an example with a textbox... It sounds like some basic string/text manipulation is all you need. If you want to deal with lines, maybe consider using String.Split or File.ReadAllLines to get each line of text as a separate string within an array. Then, if you want to remove a line you can create a new string array with only the lines you want, and then replace the original text data with your new text data (likely involving String.Join or File.WriteAllLines). Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.