亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

javascript下高性能字符串連接StringBuffer類

 更新時間:2010年08月16日 23:38:14   作者:  
使用StringBuffer類比使用加號節(jié)省50%左右的時間,大家對于大數(shù)據(jù)的連接最好使用這個方法。
復(fù)制代碼 代碼如下:

function StringBuffer(){
this.__strings__ = new Array();
}
StringBuffer.prototype.append = function(str){
this.__strings__.push(str);
};
StringBuffer.prototype.toString = function(){
this.__strings__.join(" ");
};

其實上面的代碼,主要利用了js的數(shù)組原理實現(xiàn)。

相關(guān)文章

最新評論