【asp中join函数实现字符串】asp中join函数实现字符串连接

更新时间:2017-05-27    来源:php函数    手机版     字体:

【www.bbyears.com--php函数】

(list[,delimiter])

参数 描述
list Required. A one-dimensional array that contains the substrings to be joined
必选项。包含要联接的子字符串一维数组。
delimiter Optional. The character(s) used to separate the substrings in the returned string. Default is the space character
可选项。在返回字符串中用于分隔子字符串的字符。如果省略,将使用空字符 ("")。 如果 delimiter 是零长度字符串,则在同一列表中列出全部项,没有分界符。

实例 1

 代码如下 dim a(5),b
a(0)="Saturday"
a(1)="Sunday"
a(2)="Monday"
a(3)="Tuesday"
a(4)="Wednesday"
b=Filter(a,"n")
document.write(join(b))
输出:Sunday Monday Wednesday

实例,测试效率

 代码如下 <%
Dim a(10000),i,t
t=Timer
For i=0 to 10000
a(i)=CStr(i)
Next
Response.Write Join(a,vbCrLf)
Response.Write timer-t
Erase a
%>

速度可以和php一拼(虽然还是没有他快),
另一种用法是

 代码如下 s=Join(Array("1","2","3",.....,"9999"))

速度依然比"1" & "2" & "3" & .....& "9999"要快很多

本文来源:http://www.bbyears.com/jiaocheng/32934.html

猜你感兴趣