SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Replace function not working in Classic ASP - Result = 500

    Hello,

    I've been trying to replace double quotes that are within a variable with single quotes as this is being outputted into a meta tag and when the double quotes are left in place it displays the information on the page as it closes the tag.

    The function I've seen used online is Replace(description,""", "'") ... When I use this function my page products a 500 ERROR.

    Please can someone advise as to why this wouldn't work, or another solution?

    Thanks,

    Shaun Swales

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,018
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hey Shaun,

    Because the quotes are the delimiter, they're going to give you problems...

    Try this:
    Code:
    replace(description, chr(34), "'")
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much!!!!!!! Worked a treat!

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,018
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Fantastic! Glad to hear it.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development


Tags for this Thread

Bookmarks

Posting Permissions

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