попробуй как в примере:

Код:
String.prototype.replace = function (findWhat, replaceWith) {
if (findWhat != undefined and findWhat != "") {
this = (this.split (findWhat)).join (replaceWith);
}
return this;
};
d = "1\n\n2";
trace (d);
f=d.replace ("\n\n", "\n");
trace (f);