js高效拼接字符串 - ie6,ie7
//Concat string efficiently, ie6-7
function StringBuilder() {
this.data = [];
}
StringBuilder.prototype.append = function(item) {
this.data.push(item);
return this;
};
StringBuilder.prototype.toString = function() {
return this.data.join("");
};
String.prototype.replaceAll = function(s1, s2) {
return this.replace(new RegExp(s1, "gm"), s2);
};