2 Replies Latest reply on Jul 6, 2006 2:38 PM by BKBK

    smarter "REPLACE"

    Level 7
      I need help on "Replace" function to make it work smarter. I need to clean
      all tags from the database records because the page should not be formatted.
      Using a series of "Replace" function as shown below is not comprehensive and
      not pretty. Is there a way to remove all tags in one shot?

      <cfset content_result = "#Replace(content_result, "<br>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</br>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<br />", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<p>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</p>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<h2>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</h2>", ". ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<h3>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</h3>", ". ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<h4>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</h4>", ". ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<ul>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</ul>", ". ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "<li>", " ", "ALL")#">
      <cfset content_result = "#Replace(content_result, "</li>", ". ", "ALL")#">