在 javascript 中使用 string buffer 的方法
function StringBuffer(){
this.content = new Array;
};
StringBuffer.prototype.append = function(str) {
this.content.push(str);
};
StringBuffer.prototype.toString = function() {
return this.content.join('');
};
function StringBuffer(){
this.content = new Array;
};
StringBuffer.prototype.append = function(str) {
this.content.push(str);
};
StringBuffer.prototype.toString = function() {
return this.content.join('');
};