错误提示:
C:\Inetpub\wwwroot\Test\WebForm1.aspx.cs(55): 名称“replace”在类或命名空间“Test.WebForm1”中不存在
C:\Inetpub\wwwroot\Test\WebForm1.aspx.cs(55): 名称“chr”在类或命名空间“Test.WebForm1”中不存在
书上和好多例子都是这样写的?
TextBox1.Text.Replace(oldstring,newstring);
这句没错,但是这是VB的函数,不是C#的函数。
replace(TextBox1.Text,chr(13),"<br>")
C#相对应的是REPLACE方法:
string Replace(char oldChar,char newChar);
TextBox1.Text.Replace(Convert.ToString((char)13),"<Br>")