functionStringBuffer() {this.__strings__ =[];
};
StringBuffer.prototype.append= function(str) {this.__strings__.push(str);return this;
};//格式化字符串
StringBuffer.prototype.appendFormat = function(str) {for (var i = 1; i < arguments.length; i++) {var parent = "\\{" + (i - 1) + "\\}";var reg = new RegExp(parent, "g")
str=str.replace(reg, arguments[i]);
}this.__strings__.push(str);return this;
}
StringBuffer.prototype.toString= function() {return this.__strings__.join('');
};
StringBuffer.prototype.clear= function() {this.__strings__ =[];
}
StringBuffer.prototype.size= function() {return this.__strings__.length;
}/** 传入2个字符串进行相比高亮显示
* 例如
* 原数据一:王五张三
* 原数据二:张三李四
* 王五张三
*