Connecting Tech Pros Worldwide Help | Site Map

remove # from a string

Member
 
Join Date: Mar 2008
Location: INDIA
Posts: 50
#1: May 29 '08
Hi
I have to remove # from a string in coldfusion ..but getting error .can u help me?
plzzzzz

<cfset narrative="nrr#tive">

<cfoutput>#Replace(narrative, '##',' ', 'ALL')#</cfoutput>
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: May 29 '08

re: remove # from a string


The error's on the first line. You can't have one # in a string when you're setting it using cfset. Change it to "nrr##tive".
Member
 
Join Date: Mar 2008
Location: INDIA
Posts: 50
#3: May 30 '08

re: remove # from a string


Actually i have to change a file name .the file name is "a#b.jpg" i have to change this file name "ab.jpg"..for tht i have to remove that # ....
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: May 30 '08

re: remove # from a string


Can you show the actual code? How is the filename set? Also what is the exact error message?
Reply