AI编程助手
AI免费问答

js 字符连接对象

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

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核实处理。