(List[,delimiter])
Parameter description
List Required. A one-dimensional array that contains the substrings to be joined
Required option. Contains a one-dimensional array of substrings to join.
Delimiter Optional. The character (s) used to separate the substrings in the returned string. Default is the space character
Options available. The character used to delimit substrings in the return string. If omitted, the null character ("") is used. If delimiter is a 0-length string, all items are listed in the same list without a delimiter.
Instance 1
The code is as follows |
Copy Code |
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)) Output: Sunday Monday Wednesday |
example, test efficiency
The code is as follows |
Copy Code |
<% 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 %>
|
Speed can be spelled with PHP (though still not as fast as he does),
Another way to use it is
The code is as follows |
Copy Code |
S=join (Array ("1", "2", "3",....., "9999")) |
The speed is still much faster than "1" & "2" & "3" & .....& "9999"