Deleting/Editing a line in a file.
Hi all, I'm new to .NET C# and I have a challenge to delete or edit a line from a text file which contains 1000 lines. How do I check for the position of the line? And is the a replace method I could use do replace this line with a new one? Currently I search for a line I want to manipulate using Regular Expressions. All I need to know is how can I replace that line?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Scott LysleRank #49 · 31K reputationPosted May 20, 2008, 9:23 AM EDT
Remove takes as arguments the starting position and the length (of characters to remove).
Replace takes as arguments the old and new strings or character to replace.
Johnny GC44 reputationPosted May 20, 2008, 8:58 PM EDT
you can read the file to a big string and split it into string array (splitted by CRLF or what the terminator is) and then manipulate that array or make a List