复制代码 代码如下:
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
时间: 2024-09-24 11:18:27