c# - Removing block of code from class if condition is met -
this question has reply here:
how delete line text file in c#? 8 answerswhat i'm doing reading file line line, , comparing each line that's read pre-specified string. if it's match, want remove code class i'm inspecting, starting @ line matched pre-specified string until designated location i've identified reached. i'm struggling how implement removal. i've written methods add, subtract, adjust, etc., never remove chunk of code, don't know how procede. bet there's simple way accomplish this, it's escaping me right now.
it sounds asking "how remove middle of file?" - happens source code.
the easiest way create temp file (or in memory stream) write content want maintain , when done processing old file over-write contents take keep.
c#
No comments:
Post a Comment