Link to home
Start Free TrialLog in
Avatar of analytica
analytica

asked on

Replace double quotes in a String

Hi,
How to replace a double quote in VB6.0
I try the code
     Replace(sQue, Chr(34), """)

where sQue is of type String
but its not working.

Thanks
Avatar of nathaniel
nathaniel
Flag of Philippines image

you may use the four quotes, """"

sample: """" & StringVariable & """"
ASKER CERTIFIED SOLUTION
Avatar of JonothanTompson
JonothanTompson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IT-Schubertz
IT-Schubertz

should be:

Replace(sQue, Chr(34), "")

it's as simple as that.

the problem is as Jonothan says....

Temp = Replace(sQue, Chr(34), """)

will work...

Replace DOESNT modify the original string passesd, it only modifies a copy of the same and returns the 'replaced' version.
try

sQue =  Replace(sQue, Chr(34), """)

That should work.

Cheers
Simple, Eazy, perfect solution that i will use:

Let say our variable strString contains the value "Sunny" (A string with quotes around it)

So to remove the quotes:
strString = Replace(strString,Chr(34),"")

Explaination:
strString = Replace(strString, Chr(34), TwoDoubleQuotes)

Hope I helped

Ritesh Khanna