I have a C # program where I use a lot of RegEx.Replace to replace text in a text file.
Here is my problem.
In my text file I have code such as "M6T1". This code is listed in many places in a text file.
However, I want to remove it only from the bottom (last instance) in the text file. The bottom of the text file will always be "M6T1", but this is not always the last line. It can be the 3rd line from the bottom, the 5th line from the bottom, etc.
I only want to get rid of the last instance of "M6T1", so RegEx.Replace does not work here. I do not want to interfere with another "M6T1" elsewhere in the text file.
Can someone please give me a solution to this problem?
thank
source
share