I'm trying to read a file line by line, search for a string in the line, need to replace it with a different string without overwrite & without using another file to save the information.
So far I got:
public void InsertOrUpdate(string s) {
string line = "";
StreamReader file = new StreamReader(this.filename);
while ((line = file.ReadLine()) != null) {
if (line.Contains(s)) {
// This found line I want to replace.
}
}
}