use regular expressions, for example, something like
string s = ".........";
s = Regex.Replace(s,@"<!--替换文字标记start-->.*<!--替换文字标记end-->"
,"........anything here .........", RegexOptions.IgnoreCase | RegexOptions.Singleline);
or you want to leave the comments, something like
string s = ".........";
s = Regex.Replace(s,@"(?<=<!--替换文字标记start-->).*(?=<!--替换文字标记end-->)"
,"........anything here .........", RegexOptions.IgnoreCase | RegexOptions.Singleline);