Function: The Split function returns a one-dimensional array based on 0 that contains the specified number of substrings
Grammar:
Split (Expression[,delimiter[,count[,compare]])
Parameters:
| Parameters |
Describe |
| Expression |
Required option. A string expression that contains substrings and delimiters. If expression is a zero-length string, split returns an empty array, which is an array that contains no elements and data. |
| Delimiter |
Options available. The character used to identify the bounds of the substring. If omitted, use a space ("") as the separator. If delimiter is a zero-length string, returns the set of cell numbers that contain the entire expression string. |
| Count |
Options available. The number of substrings returned,-1 indicates that all substrings are returned. |
| Compare |
Options available. Indicates the numeric value of the comparison type to use when calculating the substring. You can select one of the following values: 0 = vbbinarycompare-perform binary comparison 1 = vbTextCompare-Performs a text comparison. |
Example:
Dim txt,a1
txt= "A,b,c,d,e,f"
A1=split (TXT, ",")
For the i=0 to UBound (A1) ' UBound function to get the total number of arrays
Response.Write A1 (i) & "<br>" outputs the string in the first array
Next
The result of the final output is:
A
B
C
D
E
F
-->