|Split Function (VB6)|
Split (expression, [delimiter[, count[, compare]]])
Data Type: String
A string to be broken up into multiple strings.
Data Type: Variant
The character used to delimit the substrings in expression.
Data Type: Long
The number of strings to return.
Data Type: VbCompareMethod constant
The method of comparison. Possible values are vbBinaryCompare, vbTextCompare, or vbDatabaseCompare.
A variant array consisting of the arguments passed into the function.
Parses a single string containing delimited values into an array
Rules at a Glance
The returned array is always base regardless of any Option Base setting.
If delimiter isn't found in expression, Split returns the entire string in element of the return array.
If delimiteris omitted, a space character (" ") is used as the delimiter.
If count is omitted or its value is –1, all strings are returned.
The default comparison method is vbBinaryCompare.
Once count has been reached, the remainder of the string is placed, unprocessed, into the next element of the returned array.
Programming Tips and Gotchas
The array you declare to assign the return value of Split must be a dynamic, single-dimension string array, or a variant.
Strings are written to the returned array in the order in which they appear in expression.
- Join Function