Forum Moderators: open

Message Too Old, No Replies

Removing quotation marks

         

defanjos

3:44 am on May 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a field in a DB (F1) that has data in the following format "word" - basically the text in the field is surrounded by quotation marks.

How can I remove only the quotation marks? I want to go through every entry and remove the quotation marks.

I tried the replace command, but it errors because I cannot have the quotation mark surrounded by quotation marks.

This is the code I used (partial):

dim str1
do until rs.eof

str1 = rs("F1")
str1 = replace(str1," " ","")
rs("F1") = str1
rs.update

rs.movenext
loop

Thanks

WebJoe

4:39 am on May 24, 2003 (gmt 0)

10+ Year Member



I think this should work:


dim str1
do until rs.eof


str1 = rs("F1")
str1 = replace(str1,"""","")
rs("F1") = str1
rs.update


rs.movenext
loop

using a quotation mark as escape character

musicales

4:50 pm on May 24, 2003 (gmt 0)

10+ Year Member



I use chr(34) instead as in
str1 = replace(str1,chr(34),"")

i just find that easier to understand than WebJoe's example, where you always have to remember how many quotation marks to use!

defanjos

4:51 pm on May 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks WebJoe, it worked.

defanjos

4:55 pm on May 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks musicales, your example also works.