Thanks. But can you tell if this code will work as a database update statement? Because what i need to do is Update the column value of: Adi5RT-Flo12Roy-3(Lg) with the value: Adi5RT-Flo12Roy_3(Lg). Thanks for your help.
On 8/3/05, Ewok <[EMAIL PROTECTED]> wrote: > Here's a quick and dirty one... > > <cfset tmp = arraynew(1)> > > <cfset tmp[1] = "Adi5RT-Flo12Roy-3(Lg)"> > <cfset tmp[2] = "Adi5RT-FSU2Red-2(Md)"> > <cfset tmp[3] = "Adi5RT-FSU2Red-3(Lg)"> > <cfset tmp[4] = "Adi5RT-FSU2Red-4(XL)"> > <cfset tmp[5] = "Adi5RT-FSU2Red-5(2X)"> > <cfset tmp[6] = "Adi5RT-FSU3Wht-2(Md)"> > <cfset tmp[7] = "Adi5RT-FSU3Wht-3(Lg)"> > > <cfloop from="1" to="#arraylen(tmp)#" index="i"> > > <cfset tmp[i] = listfirst(tmp[i], "-") & "-" & listgetat(tmp[i], 2, "-") & > "_" & listlast(tmp[i], "-")> > > </cfloop> > > > <cfdump var="#tmp#"> > > > > -----Original Message----- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 03, 2005 8:05 PM > To: CF-Talk > Subject: String replace > > Hi I have a db column as displayed below. I want to replace the last > "-" with a underscore "_". Note: I don't want to replace all the > dashes. Just the last one. It should look like this: > Adi5RT-Flo12Roy_3(Lg). Any ideas? > > Adi5RT-Flo12Roy-3(Lg) > Adi5RT-FSU2Red-2(Md) > Adi5RT-FSU2Red-3(Lg) > Adi5RT-FSU2Red-4(XL) > Adi5RT-FSU2Red-5(2X) > Adi5RT-FSU3Wht-2(Md) > Adi5RT-FSU3Wht-3(Lg) > > Thanks, > Kenny > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213679 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

