经典的asp把字符串放在双引号中

时间:2014-09-18 06:31:33

标签: asp-classic

remitclient2 = Replace(remitclient2 ,"class=" Chr(34) & ls & chr(34) ">", "^")

我想将class="ls">替换为^

在经典的asp中我也尝试了转义序列,在上面我使用了chr(34)

Microsoft VBScript编译错误'800a03ee'预期')'/ US_Offer_2014 /lasttry.asp,第35行remitclient2 =替换(remitclient2,“class =”Chr(34)& ls& chr(34)“>”,“^ “)

3 个答案:

答案 0 :(得分:1)

remitclient2 = Replace(remitclient2 ,"class=""ls"">", "^")

您可以通过将字符串中的引号加倍来快速轻松地完成此操作。如果您需要在字符串的开头或结尾处引用引号,请记住也包括外引号,如下所示:

"abc""def" - quote in the middle
"""abcdef" - quote at the beginning
"abcdef""" - quote at the end

答案 1 :(得分:0)

remitclient2 = Replace(remitclient2 ,"class=""ls"">", "^")

是我试过的答案

答案 2 :(得分:0)

我认为您只是遗漏了几个& s:

 remitclient2 = Replace(remitclient2 ,"class=" & Chr(34) & ls & chr(34) & ">", "^")