Html 在VB中用“”替换“”

Html 在VB中用“”替换“”,html,vb.net,Html,Vb.net,问题:我试图用空格替换回车符。因此,我有以下几点: txt="This is a beautiful day!<BR>" response.write(Replace(txt,"<BR>"," ")) <%Dim auth As String = "Reason" Dim txt As String = " You may contact your provider for detailed information about your diagnosis or

问题:我试图用空格替换回车符。因此,我有以下几点:

txt="This is a beautiful day!<BR>"
response.write(Replace(txt,"<BR>"," "))
<%Dim auth As String = "Reason"
Dim txt As String = " You may contact your provider for detailed information about your diagnosis or treatment. This could include the detailed codes and their meanings."
auth = auth.Replace("<BR>", " ")
Dim txt1 As String = auth + txt
Response.Write(txt1)
%>
Blah blah blah.
You may contact your provider....
我还尝试了以下方法:

txt="This is a beautiful day!<BR>"
response.write(Replace(txt,"<BR>"," "))
<%Dim auth As String = "Reason"
Dim txt As String = " You may contact your provider for detailed information about your diagnosis or treatment. This could include the detailed codes and their meanings."
auth = auth.Replace("<BR>", " ")
Dim txt1 As String = auth + txt
Response.Write(txt1)
%>
Blah blah blah.
You may contact your provider....
我如何实现:

Blah blah blah. You may contact your provider....

任何帮助都将不胜感激。

我是不是遗漏了什么

    Dim txt = "This is a beautiful day!<BR>"
    txt = txt.Replace("<BR>", " ")
    MessageBox.Show(txt)

你的函数看起来是正确的;它应该是删除的。但是,文本行末尾也可能有Visual Basic换行符。尝试将此函数添加到当前替换函数下方,以删除该换行符(如果存在):

auth = auth.Replace(VbCrLf, "")
为了完整起见,您还可以添加以下内容:

auth = auth.Replace(VbCr, "")
auth = auth.Replace(VbLf, "")

你试过你的回答了吗?写代码?你有错误吗?@freginold有,我没有错误。发生的情况是没有用空格替换,并且不确定您的加入/附加看起来像什么?您是否检查了HTML以确保没有删除?我有一个问题,对不起,VB新手,vbCr、VbLf等代表什么?我会补充这一点,看看会发生什么。感谢You@RobertoFlores这些常量在Visual Basic中用于表示行尾字符。VbCr是回车符,如\r;VbLf是换行符,如\n;VbCrLf是两个字符,如\r\n。