I think you might find a RegEx using back-referencing and look-ahead is the 
way to go...

REReplace(variables.start_str,'(..)(?!$)','\1:\2','all');

Full test below.

<cfscript>
variables.start_str = '1Z0617756740260660';
variables.end_str = REReplace(variables.start_str,'(..)(?!$)','\1:\2','all
');
writeOutput(variables.start_str & '<br>'); // Initial String
writeOutput('1Z:06:17:75:67:40:26:06:60<br>'); // Target result
writeOutput(variables.end_str); // Actual Result
abort;
</cfscript>

Rawdy



On Thursday, July 11, 2013 12:28:23 AM UTC+10, rai...@ozemail.com.au wrote:
>
>  Hi I am trying to figure our the best way to manipulate the value using 
> CF so I insert : after ever 2 characters  as in converting 
> 1Z0617756740260660 to 1Z:06:17:75:67:40:26:06:60
>
>  
>
> Any suggestions would be appreciated
>
>  
>
>  
>
>  
>
> Kind Regards
>
>  
>
> Claude Raiola
>
> Director
>
>  
>
> [image: logo_new]
>
>  
>
> TrackingCentral Pty Ltd (A.C.N. 150 409 180)
>
> Web: www.TrackingCentral.com.au <http://www.trackingcentral.com.au/>
>
> Email: in...@trackingcentral.com.au <javascript:>
>
> Call 1300 255 990
>
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to