split was the clear winner here. Given splitBy, I basically recreated split as a lambda.
I tried to create an analog to that where splitBy would come out looking better. I figured that if we didn't know the dimensionality of our data, then delimiters becomes an array of arbitrary length and we could pass data.!splitBy into something like delimiters.reduce. When actually writing that, however, I wound up recreating split again:
Consider this crude csv parser:
using splitBy:
using split: split was the clear winner here. Given splitBy, I basically recreated split as a lambda.I tried to create an analog to that where splitBy would come out looking better. I figured that if we didn't know the dimensionality of our data, then delimiters becomes an array of arbitrary length and we could pass data.!splitBy into something like delimiters.reduce. When actually writing that, however, I wound up recreating split again:
using splitBy:
using split: