Andy Jarrett // Code. Develop. Create.

reReplace or replace that is the question

Well i had to play, these sort of things always have get my interests going. This starts in a post atalt.comp.lang.coldfusionwhere Drew asked - "I'm trying to take this value 0.85 and turn it into 85, or 1.35 and turn that into 135."

There were a few answers but two revolved around using reReplace() & replace(), and it was these which prompted me to see which would be best for the job.Well the results we quite good, though i also tested on CF4.52 - now this was amazing. Ok, heres test 1:











#loopTime#

and heres test 2













#loopTime#

Test 1 Test 2
CF4.5 CFMX CF4.5 CFMX
1. 5939 2223 4627 190
2. 5887 2163 4737 200
3. 5908 2153 4817 191
First thing, WOW how did we work with CF4.5.
Anyway as you can see that by not using the regex engine the CFMX the times drop by roughly 100%.

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️