I tried Tig's replacetext, but I couldn't get it to work, so I had to create my own. I thought I'd post it here in case anyone wanted to use it.
PHP Code:
function replacetext(txt,a,b) {
if (txt.pos(a)<0) return txt;
temp.txtpos = txt.positions(a);
temp.newtxt = txt.substring(0,txtpos[0]);
for (temp.i=0;i<txtpos.size();i++) {
newtxt @= b;
newtxt @= txt.substring(txtpos[i]+a.length(),txt.substring(txtpos[i]+a.length()).pos(a));
}
return newtxt;
}
Functions simply via:
temp.test = replacetext("Hello\n \"world how\"\n\n are you?","\n",",");
will return Hello, "world how",, are you?(sorry I stole your thing, Tig!)
I don't know how efficient it is, but I got it working so I was happy with it.