Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using replace() to get rid of ascii code

Status
Not open for further replies.

WannaLearn

Programmer
Jul 10, 2001
210
0
0
US
Hi, I have tired the following and does not work, any ideas why?

<cfset clubname = replace(retrieveoutputtempfile.clubname, "#chr(38)##chr(35)#174", """","all")>
and
<cfset clubname = replace(retrieveoutputtempfile.clubname, chr(174), chr(160), "all")>


I want to repalce all instances of the registered symbol (asci: chr(174), html: &#174) with blanks.

Any ideas why my code doesnt work? HOw can I fix this?

This is what the original phrase is: Citi® Platinum Select® Card
 
this works for me.

Code:
<cfoutput>
<cfset myVar = "Citi® Platinum Select® Card">
<cfset myVar = replaceNoCase(myVar,chr(174),"","All")>
<cfset mySecondVar = "Citi&##174 Platinum Select&##174 Card">
<cfset mySecondVar = replaceNoCase(mySecondVar,"&##174","","All")>
#myVar#<br>
#mySecondVar#<br>
</cfoutput>

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top