VBScript Split
Function
The Split function returns a zero-based one-dimensional array containing a specified number of substrings.
Syntax
Parameter | Description |
---|---|
expression | Required. A string expression that contains substrings and delimiters. |
delimiter | Optional. The character used to identify substring boundaries. The default is the space character. |
count | Optional. The number of substrings to be returned. -1 indicates that all substrings are returned. |
compare | Optional. Specifies the type of string comparison to use. Possible values: 0 = vbBinaryCompare - Performs a binary comparison<br> 1 = vbTextCompare - Performs a textual comparison |
Example
Example 1
Output of the above example:
Example 2
Splitting text using the delimiter parameter:
Output of the above example:
Example 3
Splitting text using the delimiter and count parameters:
Output of the above example:
Example 4
Splitting text using the delimiter parameter with textual comparison:
Output of the above example:
Example 5
Splitting text using the delimiter parameter with binary comparison:
Output of the above example: