Solved

Replace double quotes in a String

Posted on 2004-04-26
9
823 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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

777 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