时间:2021-07-01 10:21:17 帮助过:36人阅读
title=request("title")
title=replace(title,"chr(34)","""")
asp里出现双引号时 要改成两个双引号
asp将单引号替换为双引号
有网友反应将单引号'换成双引号",用replace(string,"'",""")会出现语法错误
正确的写法应该是replace(string,"'","""")
或:
replace(string,chr(39), chr(34))
代码如下:
Function EChar(ParaStr)
ParaStr=trim(ParaStr)
ParaStr=replace(ParaStr,chr(39),"'")
ParaStr=replace(ParaStr,chr(34),""")
EChar=ParaStr
End function
Function DChar(ParaStr)
ParaStr=replace(ParaStr,"'",chr(39))
ParaStr=replace(ParaStr,""",chr(34))
DChar=ParaStr
End function