WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE
The Join function returns a string that consists
of a number of substrings in an array. Returns a string created
by joining a number of substrings contained in an array. A one-dimensional
array containing substrings to be joined. A string character used
to separate the substrings in the
returned string. If omitted, the space character (" ")
is used. If delimiter is a zero-length string, all items in the
list are concatenated with no delimiters. The Join function combines
substrings (elements) of an array together into one long string
with each substring separated by the delimiter string. Gives
a string created by joining a number of substrings contained in
an array. The Join() function converts the elements of an array
into a string using a custom delimiter.
The Syntax of the Join Function is
:-
Example#1 :-
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#2 :-
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#3 :-
Code :-
Dim MyString
Dim MyArray(3)
MyArray(0) = "Mr."
MyArray(1) = "John "
MyArray(2) = "Doe "
MyArray(3) = "III"
Output :-
MyString = Join(MyArray) '
MyString contains "Mr. John Doe III".
Hence, Join contains "Mr. john Doe III". |
Example#4 :-
Code :-
<% Dim cowarray(10) %>
<% cowarray(0) = "How" %>
<% cowarray(1) = "now" %>
<% cowarray(2) = "brown" %>
<% cowarray(3) = "cow?" %>
<% Join(cowarray) %>
Output :-
How now brown cow?
|
|