CR or parentheses after), and then actually replace scx.methods with stuff(methods, position, length, newstring) for each occurence of the string. Preferrably, you may use an array to look for positions of all of the occurences of the string, and then replace them last to first, so their positions don't move.
>
>For som reason, I enjoy string manipulation. Thanks for suggesting an approach. I particularly liked the "last to first" idea that would allow the pre-evaluated "position" parameter in your stuff() example to remain correct all the way through.
I've made it when I needed it bad - I was writing a parser to convert tons of .prg files from something into something else. Really worked faster this way, since I've chopped the string to find the searchstring, always looking for the 1st occurrence in the rest of string (looking for 25th occurrence in a 12K string may be time consuming). Building an array of positions was a must, else it took too long.