Quick Replace question...

Results 1 to 5 of 5

Thread: Quick Replace question...

  1. #1
    Papa Zito Guest

    Default Quick Replace question...

    I&#039m trying to replace (what else?) any "s that are in a string. Right now, my Replace looks like this :<BR><BR>Description = Replace(RS("Description"),",&quot;)<BR><BR>VBScrip t tells me there&#039s an unterminated string because there&#039s no " after the one in the middle there. How do I get VBScript to recognize that I&#039m trying to replace the "? I&#039ve also tried :<BR><BR>Description = Replace(RS("Description"),&#039"&#039,&quot;)<BR>< BR>which gives me a syntax error...

  2. #2
    Neils Guest

    Default RE: Quick Replace question...

    You&#039re getting closer, try this:<BR><BR>Description = Replace(RS("Description"),"""",")<BR><BR>That&#039 s four double quotes in a row, I think it should work.

  3. #3
    Papa Zito Guest

    Default That worked great!

    That worked perfectly, thanks! It looks really strange though... do you know exactly why it works?

  4. #4
    Neils Guest

    Default RE: That worked great!

    If you want to put an actual double quote in a VB string you have to prefix it with another double quote. Since VB string delimiters are also double quotes, it looks a little strange.<BR><BR>So, the middle two quotes are translated into one character stored inside a string.<BR><BR>Not the best explanation, but it works.

  5. #5
    Papa Zito Guest

    Default RE: That worked great!

    (Since you seem to know all of this kind of stuff...) Do you know the HTML code for &#039(single-quote)? I just found that I need to get rid of those too...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts