/**************************************************
* * 字符串操作类
* * 2008-7-25
* **************************************************
* * msn:danxinju@hotmail.com
* * author:淡新举
***************************************************/
var StringBuilder = function(){
this.arr = new Array();
};

//追加字符串
StringBuilder.prototype.add = function(item){
this.arr.push(item);
};

//清空字符
StringBuilder.prototype.clear = function(){
this.arr.length = 0;
};

//转换为String
StringBuilder.prototype.toString = function(){
return this.arr.join("");
};

相关文章:

  • 2021-05-17
  • 2022-12-23
  • 2021-04-13
  • 2022-12-23
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2021-10-22
  • 2021-12-22
  • 2021-05-25
  • 2021-11-21
相关资源
相似解决方案