Solved

Replace double quotes in a String

Posted on 2004-04-26
9
808 Views
Last Modified: 2012-06-21
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
Comment
Question by:analytica
9 Comments
 
LVL 6

Expert Comment

by:nathaniel
ID: 10916092
you may use the four quotes, """"

sample: """" & StringVariable & """"
0
 
LVL 1

Accepted Solution

by:
JonothanTompson earned 125 total points
ID: 10916093
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
 
LVL 7

Expert Comment

by:IT-Schubertz
ID: 10916097
should be:

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

it's as simple as that.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:_agj_
ID: 10916196
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
 

Expert Comment

by:cyberaxis
ID: 10916781
try

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

That should work.

Cheers
0
 
LVL 1

Expert Comment

by:vrbros
ID: 11020478
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now