PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

js 字符连接对象

巴扎黑
巴扎黑 原创
2016-12-06 11:39:06 883浏览

function StringBuffer(){ 
     this.str = []; 


StringBuffer.prototype = { 
    append:function(str){ 
        this.str.push(str); 
        return this; 
   }, 
   toString:function(){ 
        return  this.str.join(''); 
   }, 
   clear:function(){ 
       this.str.length = 0; 
       return this; 
  } 
}


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。