请看源文件
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">请注意其中的 version=\"1.0\"
我想实现
version=\"1.0\" ----->version="1.0" encoding=\"UTF-8\"?> ------>encoding="UTF-8"?> 我曾试过的方法:
string str="encoding=\"UTF-8\"?> ";
str=Regex.Replace(str,"\"",""); 结果输出为 encoding=UTF-8?> 请帮忙.很急.谢谢
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">请注意其中的 version=\"1.0\"
我想实现
version=\"1.0\" ----->version="1.0" encoding=\"UTF-8\"?> ------>encoding="UTF-8"?> 我曾试过的方法:
string str="encoding=\"UTF-8\"?> ";
str=Regex.Replace(str,"\"",""); 结果输出为 encoding=UTF-8?> 请帮忙.很急.谢谢
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">"str=str.Replace(@"\","");
asp.net下测试
下表说明有效单个字符转义符及其说明。
有效单个
字符转义符 字符集 C(R)
\n 换行符 (#xA)。
\r 回车符 (#xD)。
\t 制表符 (#x9)。
\\ \
\| |
\. .
\- -
\^ ^
\? ?
\* *
\+ +
\{ {
\} }
\( (
\) )
\{ {
\} }
\[ [
\] ]
这个方法不可以么???
string str=""""
public static void Main() { string errString = "This docment uses 3 other docments to docment the docmentation";
Console.WriteLine("The original string is:{0}'{1}'{0}", Environment.NewLine, errString); // Correct the spelling of "document". string correctString = errString.Replace("docment", "document"); Console.WriteLine("After correcting the string, the result is:{0}'{1}'",
Environment.NewLine, correctString);
}
}
StringBulider _buffer=new StringBulider(1024);
_buffer.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); [这样才认]
.......
.......
string str=_buffer.Tostring();
生成的是wml文件
可是version=\"1.0\" 模拟器不认