Replace Function

S

Steven Burn

Replace(Data, Chr(34), Chr(34) & Chr(34))

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Ray at

YourString = Replace(YourString, "'", """")
'or
theNewString = Replace(YourString, "'", """")

To "escape" a " character in a string, you put it twice, "".

Mind if I ask why you're replacing ' with " though?

Ray at work
 
J

JT

how can i replace all single quotes in a string to double quotes:

Replace(strLog_text, "'", """)

however, this doesn't work, as you might expect.

any ideas??
 
S

Steven Burn

Woops.. sorry, just realised you meant ' and not ", lol

Replace(data, Chr(39), Chr(34) & Chr(34))

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
A

Aaron Bertrand - MVP

how can i replace all single quotes in a string to double quotes:

Why would you want to do that? Does O'Brien want to change his name to
O"Brien?

strLog_text = Replace(strLog_text, "'", CHR(34))
or
strLog_text = Replace(strLog_text, "'", """")
 
S

Steven Burn

I've done it again........ there's only meant to be one Chr(34)...... not
two :eek:\

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
J

jon

Replace(strLog_text, "'", """")

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Block "HEAD" method? 2
IIS 4
[OT] Server 2003 + Access 23
Response. and Request. 2
Just wondering 11
use the oleDBCommand in ASP 2
[Perhaps OT] Zip 2
Reverse text 78

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top