我有一个控制器,其中我将html文件读入一个变量。将一个变量的值替换为另一个值
读它之后,我从变量为其他值替换一些值,
但问题是,没有什么happend。
这里有什么问题?
有人能帮我一个忙吗?
string path = "/mypath/myfile.html";
string s = System.IO.File.ReadAllText(path);
s.Replace("@%a%@","hi");
s.Replace("@%b%@","yo");
s.Replace("@%c%@","asdfasdf");
s.Replace("@%d%@", "http://www.google.com");
.NET中的字符串是不可变的 –