我的代码到目前为止
StreamReader reading = File.OpenText("test.txt");
string str;
while ((str = reading.ReadLine())!=null)
{
if (str.Contains("some text"))
{
StreamWriter write = new StreamWriter("test.txt");
}
}
Run Code Online (Sandbox Code Playgroud)
我知道如何找到文本,但我不知道如何用我自己的文件替换文件中的文本.