asp中将有双引号标题入库的方法
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:title=request("title")title=replace(title,"chr(34)","""")asp里...
复制代码 代码如下:
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