Go Premium for a chance to win a PS4. Enter to Win

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

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
0
analytica
Asked:
analytica
1 Solution
 
nathanielSystem Applications DeveloperCommented:
you may use the four quotes, """"

sample: """" & StringVariable & """"
0
 
JonothanTompsonCommented:
Um i think your problem may be that your not setting it to anything
ie.

Dim Temp as String

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

That will do it


Jonothan
0
 
IT-SchubertzCommented:
should be:

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

it's as simple as that.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
_agj_Commented:
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.
0
 
cyberaxisCommented:
try

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

That should work.

Cheers
0
 
vrbrosCommented:
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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