programming-examples/asp/Strings/Replace Single Quotes.asp

23 lines
411 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%
Function fncReplaceSingleQuotes( _
ByVal strToReplace _
)
On Error Resume Next
Const Proc = "fncReplaceSingleQuotes"
strToReplace = Replace(strToReplace, "'", "''")
fncReplaceQuote = strToReplace
If Err.number <> 0 Then
Call subWriteError(Err.number, Proc, Err.description)
End If
End Function
'
'...
'
strVar = Request.Form("txtField1")
strVar = fncReplaceSingleQuotes(strVar)
%>