Ding Ding Ding Ding! We have a winner! Thanks Jason! Scott
----- Original Message ---- From: Jason Fisher <ja...@wanax.com> To: cf-talk <cf-talk@houseoffusion.com> Sent: Sat, April 2, 2011 10:21:16 AM Subject: Re: Including multiple variables within a database response Can use replaceList() instead. replaceList(mystring, "DECISIONMAKER,MYNAME", "Bob,Scott") On 4/2/2011 12:57 PM, Scott Williams wrote: > LOL -- I was afraid of that! It reminds me of the portrait of Stephen Colbert > standing in front of a portrait of Stephen Colbert standing in front of a > portrait of Stephen Colbert ad infinitum. > > Scott > > > > ----- Original Message ---- > From: John M Bliss<bliss.j...@gmail.com> > To: cf-talk<cf-talk@houseoffusion.com> > Sent: Sat, April 2, 2011 9:05:28 AM > Subject: Re: Including multiple variables within a database response > > > replace(replace(mystring, "DECISIONMAKER", "Bob", "all"), "MYNAME", "Scott", > "all") > > On Sat, Apr 2, 2011 at 11:00 AM, Scott Williams > <myscottwilli...@yahoo.com>wrote: > >> Wow! This works great! >> >> What if there are multiple things to replace within the variable? For >> example, >> you have a string like: >> >> >> "Hi DECISIONMAKER. This is MYNAME." >> >> I want to replace DECISIONMAKER with "Bob" and I want to replace MYNAME >> with >> "Scott." >> >> Scott Williams >> >> >> >> ----- Original Message ---- >> From: Brian Cain<bcc9...@gmail.com> >> To: cf-talk<cf-talk@houseoffusion.com> >> Sent: Fri, April 1, 2011 8:25:31 AM >> Subject: Re: Including a variable within a database response >> >> >> Easiest way is to use the Replace function built in to CF. >> >> >>http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_m-r_32.html >>l >> l >> >> >> < >>http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_m-r_32.html >>l >> l >>> If >> you have multiple instances of the replacement value be sure to specify the >> "All" scope. You may also want to look at the ReplaceNoCase function. >> >> Brian Cain >> >> On Fri, Apr 1, 2011 at 10:22 AM, Scott Williams >> <myscottwilli...@yahoo.com>wrote: >> >>> Hi all -- >>> >>> I have a script that draws some text from a database, and I would like to >>> embed >>> a person's name within the text. >>> >>> For example, the database field contains this text: >>> >>> Hi #name#. How's it going? >>> >>> I would like the #name# to be replaced with a previously defined variable >>> "name." >>> >>> Can ColdFusion do this? If so, how? >>> >>> Scott >>> >>> >> >> >> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343506 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm