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