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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Revisited 1

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello All,

I need your advice on strings and replaceNoString() please. In a variable I am trying to replace the string &amp with &. My replace funcion is not working, i.e. no errors but does not replace the desired string.

What can you suggest?

Code:
<cffunction name="replaceBadCharacters">
   <cfargument name="sOldString">
   <cfset sNewString = replaceNoCase(sOldString,"&amp;amp","&")>
   <cfreturn sNewString>
</cffunction>

Thanks,

Michael42
 
try
<cfset sNewString = replaceNoCase(sOldString,"&amp;amp","&", "all")>

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
 
bombboy,

Thanks for your post. It still does not seem to be changing anything. Does not add or change it in any way. Kinda weird. Can you suggest anything else?

Thanks again,

Michael42
 
bombboy,

Update - after further investigation it seems it was a problem with a ColdFusion MX XML function. I took your code and created a separate model and it worked perfect.

I'll post the XML function culprit if anyone would like to know the details.

bombboy - thanks again,

Michael42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top