Zarcou
Zarcou

Reputation: 103

How to replace double quotes in a string?

I need to replace "in a string with nothing.

I tried:

replace(mystring, """, "")

I would like:

String = " "my string " " --> " my string"

Upvotes: 10

Views: 43956

Answers (1)

JNevill
JNevill

Reputation: 50019

What you are really wanting to do is replace any instance " with a blank string. To do this:

replace(mystring, chr(34), "")

chr(34) is the character code for a double quote. You could also use replace(mystring, """", "") that """" gets evaluated as one double-quote character, but I believe the chr(34) is much less confusing.

Upvotes: 24

Related Questions