Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1009
  • Last Modified:

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.
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

Open in new window

0
jweissdandm
Asked:
jweissdandm
1 Solution
 
ThinkPaperIT ConsultantCommented:
Hmm.. This should have resolved the problem:

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').
0
 
RobinSoftware EngineerCommented:
If the above suggestion does not work, may be it is not a double quote?

Can you try and replace a ascii character 168 (ALT-0168 : ยจ), that looks like a double quoute.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now