復制代碼 代碼如下:
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