Solved

Replace double quotes in a String

Posted on 2004-04-26
9
786 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 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

20 Experts available now in Live!

Get 1:1 Help Now