string tempStr = newStr.Replace((char)13, (char)0);
return tempStr.Replace((char)10, (char)0);
这样替换成了两个(char)0,怎样替换成一个(char)0?
我这样出错了:
string as = xxx
as=as.Replace((char)13&(char)10, (char)0);错误提示:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1502: The best overloaded method match for 'string.Replace(char, char)' has some invalid arguments
return tempStr.Replace((char)10, (char)0);
这样替换成了两个(char)0,怎样替换成一个(char)0?
我这样出错了:
string as = xxx
as=as.Replace((char)13&(char)10, (char)0);错误提示:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1502: The best overloaded method match for 'string.Replace(char, char)' has some invalid arguments
比如,提交内容是:
123
456
网页源代码显示到“456”就中断了!
(char)13和(char)10该用什么符号连接?
只是不知道(char)13和(char)10该用什么符号连接~~
先结贴了~~
string 有一个构造函数的形式是 char[]。
你可以用 string breaker = new string(new char[] { char(13), char(10) });另一个问题类似。'\0'是可以的,"\0"会截去后面的字符。
非常感谢!