jweissdandm
asked on
how to remove double quote from string
Hopefully a simple solution. I am trying to pass text to a variable...
myText...
This is a "lovely day" for all of us experts.
I want to assign the text above to a variable (strData) and I want to strip out the double quotes. I am getting that text from my CMS application.
myText...
This is a "lovely day" for all of us experts.
I want to assign the text above to a variable (strData) and I want to strip out the double quotes. I am getting that text from my CMS application.
I have been using this without any luck
function cleanString(myString)
myString = replace(myString,"'","")
myString = replace(myString,"","")
myString = replace(mystring,"", "")
myString = replace(mystring,"", "")
' myString = Replace(mystring, """, "")
mySring = Replace(mystring, "'", "")
myString = replace(mystring, """","")
'myString = replace(mystring,"chr(34)","")
'myString = replace(mystring, chr(34),"")
cleanString = myString
end function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
myString = replace(mystring, """","")
I wonder if it's an issue with it going thru the function properly. What happens when you run the replace directly on the string itself, then print it out to see?
mystring = 'This word is "quoted" yo.'
mystring = replace(mystring, """","")
response.write mystring
If it still fails, do a replace for another character just to ensure it is working properly (say, the character 'o').