From the answer at https://stackoverflow.com/a/52375669/1427563 I used the following recursive SASS function to split a string into a list of substrings, given a separator.