Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace function

Status
Not open for further replies.

benrob82

Programmer
Jul 28, 2005
116
GB
Hi can anyone help me to replace " in a replace function?

Thanks in advance
 
To replace " with '

replace(string,"""","'")


--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
you want to replace " with what??

here is the syntax:

REPLACE(yourfield,whatyouwanttoreplace,newreplacement)

-DNG
 
You could also refer to the double quote character by its ASCII value like this:
[tt]sDoubleQuote = Chr(34)
sSingleQuote = Chr(39)
MyString = Replace(MyString, sDoubleQuote, sSingleQuote)
[/tt]

Or I guess you could also do this:
[tt]MyString = Replace(MyString, Chr(34), "'")[/tt]
 
i am not sure why you guys are assuming that benrob82 wants to replace double quote with a single quote...just curious...

-DNG
 
I'm not getting that, either.

Maybe it's
Code:
Replace(theThing, """", """)
or
Code:
Replace(theThing, """, """")
or
Code:
Replace(theThing, """", "\""")
or something else entirely.
 
Personally I wasn't assuming, just used it as an example.

replace(string,"""","anchovie")

[peace]

--------------------------------
Rome did not create a great empire by having meetings, they did it by killing all those who opposed them.
 
Hi all thanks for the replies but the fiest post solved it, I wanted to remove the " totally which was solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top