replacing first and last occurrences in a string

2008-12-05 Thread Mike Little
hi guys, i have some text as follows... bulletblah blah/bullet bulletblah blah/bullet bulletblah blah/bullet bulletblah blah/bullet i need to insert this into a text field using proper html eg. ulli for the lists. so i need to replace the first occurrence of bullet with ulli, and the last

Re: replacing first and last occurrences in a string

2008-12-05 Thread Barney Boisvert
Simple and hackish is to just reverse the string, replace tellub/ with lu/il/, and then reverse the string again. If you know the final /bullet is at the end of the string, you could use /bullet$ in REReplace. cheers, barneyb On Fri, Dec 5, 2008 at 2:35 PM, Mike Little [EMAIL PROTECTED] wrote:

Re: replacing first and last occurrences in a string

2008-12-05 Thread Mike Little
thanks heaps barneyb... cfset new_text = reverse(trim(mytext)) cfset new_text = replaceNoCase(new_text, tellub/, lu/il/, One) cfset new_text = reverse(new_text) cfset new_text = replaceNoCase(new_text, bullet, ulli, One) cfset new_text = replaceNoCase(new_text, bullet, li, All) cfset new_text =

Re: replacing first and last occurrences in a string

2008-12-05 Thread Charlie Griefer
scope creep! On Fri, Dec 5, 2008 at 3:40 PM, Mike Little [EMAIL PROTECTED] wrote: thanks heaps barneyb... cfset new_text = reverse(trim(mytext)) cfset new_text = replaceNoCase(new_text, tellub/, lu/il/, One) cfset new_text = reverse(new_text) cfset new_text = replaceNoCase(new_text,