web 2.0

ASP/VBScript Split()

ASP/VBScript Split() Returns a zero-based, one-dimensional array containing a specified number of substrings.

ShotDev Focus:
- Using Asp and Split() function.

Example

asp_split.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim strSplit
strSplit = Split("1,2,3",",")
Response.write strSplit(0)&"<br>"
Response.write strSplit(1)&"<br>"
Response.write strSplit(2)&"<br>"

Response.write("<hr>")

Dim strSplit2,i
strSplit2 = Split("a,b,c,d,e",",")
For i = 0 To UBound(strSplit2)
Response.write strSplit2(i)&"<br>"
Next

'*** Split("a,b,c,d,e",",")(0)
'*** Split("a,b,c,d,e",",")(1)
'*** Split("a,b,c,d,e",",")(2)
'*** Split("a,b,c,d,e",",")(3)
'*** Split("a,b,c,d,e",",")(4)
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_split.asp

Screenshot

ASP/VBScript & Split()

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.