当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个asp快速字符串连接类

ASP
用ASP编写网络传呼机
用ASP+CSS实现随机背景
ASP下载系统防盗链方法
用ASP编写下载网页中所有资源的程序
Request.ServerVariables应用
解决Asp程序的Server.CreateObject错误
ASP实现TCP端口扫描的方法
源码实例:ASP实现远程保存图片
用ASP+DLL实现WEB方式修改服务器时间
ASP使用MySQL数据库全攻略
ASP+SQL Server构建网页防火墙
教程/ASP 十天学会ASP之第二天
教程/ASP 十天学会ASP之第四天
教程/ASP 十天学会ASP之第五天
教程/ASP 十天学会ASP之第六天
教程/ASP 十天学会ASP之第七天
教程/ASP 十天学会ASP之第八天
教程/ASP 十天学会ASP之第九天
教程/ASP 十天学会ASP之第十天
关于学习ASP和编程的28个观点

ASP 中的 一个asp快速字符串连接类


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 43 ::
收藏到网摘: n/a

<%
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'快速字符串连接类
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'名称:Class_FastString
'来源:http://www.jansfreeware.com
'整理:qihangnet
'更新:2005年6月15日
'作用:高效地进行字符串连接,比 str = str & "abc"的方法快很多
'授权:免费使用
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Class Class_FastString
'************************************
'变量定义
'************************************
'index --- 字符串数组的下标
'ub ------ 用于调整数组度数的整数变量
'ar() ---- 字符串数组
Private index, ub, ar()
'************************************
'实例 初始化/终止
'************************************
Private Sub Class_Initialize()
Redim ar(50)
index = 0
ub = 49
End Sub
Private Sub Class_Terminate()
Erase ar
End Sub
'************************************
'事件
'************************************
'默认事件,添加字符串
Public Default Sub Add(value)
ar(index) = value
index = index+1
If index>ub Then
ub = ub + 50
Redim Preserve ar(ub)
End if
End Sub
'************************************
'方法
'************************************
'返回连接后的字符串
Public Function Dump
Redim preserve ar(index-1)
Dump = join(ar,"") '关键所在哦^_^
End Function
End class
%>