Solved

Replace double quotes in a String

Posted on 2004-04-26
9
874 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Industry Leaders: 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!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

752 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