I am trying to replace all occurances of double quotes (" in a string with single quotes ('). I have the following code that works for replacing words, but...
1. It only replaces the first occurance of the word.
2. I cannot figure out if I can change it to find and replace the quotes not a word.
Any suggestions?
The Function...
function ReplaceItem(patrn, replStr)
Dim regEx, str1
str1 = Request.Form("Reason" -->this is from my form
set regEx = New RegExp
regEx.Pattern = patrn
ReplaceItem = regEx.Replace(str1, replStr)
End Function
Here's how I call it...
<%Response.write( ReplaceItem("word2replace","withThis")%>
1. It only replaces the first occurance of the word.
2. I cannot figure out if I can change it to find and replace the quotes not a word.
Any suggestions?
The Function...
function ReplaceItem(patrn, replStr)
Dim regEx, str1
str1 = Request.Form("Reason" -->this is from my form
set regEx = New RegExp
regEx.Pattern = patrn
ReplaceItem = regEx.Replace(str1, replStr)
End Function
Here's how I call it...
<%Response.write( ReplaceItem("word2replace","withThis")%>