Hello,
I'm trying to replace two special characters using the replace function in ColdFusion:
<cfset MyQuery = "/Attribute One\/Attribute Two\/Attribute Three\">
<cfset MyString = Replace(MyQuery, "/", "<li>", "ALL")>
<ul>
<cfoutput>#MyString#</cfoutput>
</ul>
This works well, but I need to correctly close my li tags. I tried adding the following which did not work:
<cfset MyString = Replace(MyQuery, "/", "<li>", "ALL") AND Replace(MyQuery, "\", "</li>", "ALL")>
First question: Is this the right way to what I'm attempting? Or should I just store my html inside the database along with the attributes?
Second question: If my approach is correct, could someone please provide an example of the correct syntax?
Many thanks!