>Shouldn't be, the string to replace is coming from the big string, i.e. it's derived from it using substr(), so actually ATC() can be replaced with an AT() here.
>
>And this goes successfully hundreds of times and then starts skipping some replaces.
Why do you need loop in the first place?
--sb--