CorString: Split |
Splits a string into a maximum number of substrings based on the strings or characters in an array. You can specify whether the substrings include empty array elements.
Public Function Split( ByRef s As String, ByRef Separator As Variant, Optional ByVal Count As Long = &H7FFFFFFF, Optional ByVal Options As StringSplitOptions = StringSplitOptions. None ) As String ( )
Default: &H7FFFFFFF
Default: StringSplitOptions . None
Delimiter strings are not included in the elements of the returned array.
If the s parameter does not contain any of the strings or characters in Separator, or the Count parameter is 1, the returned array consists of a single element that contains the s parameter. If the Separator parameter is null or contains no elements, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return True if they are passed to the Char.IsWhiteSpace method.
If the Count parameter is zero, or the Options parameter is RemoveEmptyEntries and the length of the s parameter is zero, an empty array is returned.
Exception | Condition |
---|---|
ArgumentOutOfRangeException | Count is negative. |
ArgumentException | Options is not one of the StringSplitOptions values. |