Skip to main content
Known Participant
May 12, 2006
Question

ReplaceList() function Help

  • May 12, 2006
  • 2 replies
  • 519 views
I'm trying to use the ReplaceList function to replace certain characters with their Ascii/Iso equivalent (mainly the apostrophe( ' ) and the quote ( " ) before inserting them into a database. The apostrophe works fine, but I'm having problems with the " (quote), it throws a CF error.

eg: ReplaceList(fieldtoreplace, "', "", "’, "")
(example with spaces for better legability - ReplaceList(fieldtoreplace, " ', " ", "& rsquo; , & quot; ")

Is this possible? Any help would be appreciated.
    This topic has been closed for replies.

    2 replies

    May 12, 2006
    The apostrophe is valid html, you don't need to replace it.

    Also, it's not clear what you're trying to accomplish. You might give a precise complete example with desired result.

    Meanwhile try this:
    <cfset FormattedStr = HTMLEditFormat (fieldtoreplace)>
    Inspiring
    May 12, 2006
    have you considered using string functions? after all, a list is just a fancy string.