日期:2014-05-17  浏览次数:20815 次

菜鸟送分:回车换行符替换问题
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 newStr.Replace("\r\n", "\0");
------解决方案--------------------
那当然,谁让你替换成"\0"
你可以替换成空格或者别的字符看看。