How do I split a string ONLY after the first instance of the delimiter? How do I split a string ONLY after the first instance of the delimiter? vba vba

How do I split a string ONLY after the first instance of the delimiter?


From the MSDN documentation on the Split function:

By default, or when Limit equals -1, the Split function splits the input string at every occurrence of the delimiter string, and returns the substrings in an array. When the Limit parameter is greater than zero, the Split function splits the string at the first Limit-1 occurrences of the delimiter, and returns an array with the resulting substrings.

If you only want to split on the first delimiter then you would specify 2 as the maximum number of parts.

Split(expression, [ delimiter, [ limit, [ compare ]]])