07-24-2023, 12:42 PM
My code so far
StreamReader reading = File.OpenText("test.txt");
string str;
while ((str = reading.ReadLine())!=null)
{
if (str.Contains("some text"))
{
StreamWriter write = new StreamWriter("test.txt");
}
}
I know how to find the text, but I have no idea on how to replace the text in the file with my own.
StreamReader reading = File.OpenText("test.txt");
string str;
while ((str = reading.ReadLine())!=null)
{
if (str.Contains("some text"))
{
StreamWriter write = new StreamWriter("test.txt");
}
}
I know how to find the text, but I have no idea on how to replace the text in the file with my own.