Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Leaders
Posted

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).

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...