luocheng
2014-11-08 11:30:15
js面向对象定义StringBulider对象
StringBulider = function(value){ this.Strings = new Array(); if(value!=null&&value.length>0){ this.append(value) } } StringBulider.prototype.append = function(value){ if(value!=null&&value.length>0){ this.Strings.push(value); } return this; } StringBulider.prototype.toString = function(seperator){ return this.Strings.join(seperator||""); } StringBulider.prototype.clear = function(){ return this.Strings.length=0; } StringBulider.prototype.length = function(){ return this.Strings.length; } /** * 移除最后一个 */ StringBulider.prototype.lastRemove = function(){ this.Strings=this.Strings.slice(0, this.Strings.length-1); return this; }
猜你喜欢
请下载代码后再发表评论

- 使用java和javascript判断当前浏览者的操作系统
- 证 javascript简单调色板工具
- js进度条(原创可用于学习)
- {Tonfay}[js动态报表][兼容IE6+/火狐/360/谷歌/等各大浏览器][可手动设置间隔时间读取数据/并且显示在图表上]
- 证 5个小javascript特效实例
- 证精 史上最短小精悍的javascript编写的俄罗斯方块游戏,仅仅60行代码
- 正则表达式的JS验证
- 证 js canvas无限生成国风水墨画
- js打印,预览的功能.希望采纳.
- 证 JavaScript写的贷款计算器源代码下载
- 证 纯js开发的时钟,带秒钟
- 证 js万年历查询设置工作日前端源代码分享


3334004690 LV11
2024年3月6日
2602275348 LV12
2024年1月12日
成熟的小孩 LV2
2024年1月11日
养生今天不睡 LV2
2020年5月7日
luohaipeng LV23
2019年12月3日
缆车999 LV1
2019年7月9日
在雨中笑着哭 LV2
2019年4月2日
yangbinghua LV6
2019年2月1日
574881127 LV1
2018年12月2日
WSKJNQ
2017年12月7日
暂无贡献等级