(no title)
brians
|
7 months ago
Can you help me understand what’s happening between the split and the filter on “a <space> <space> <space> b”? I expect that to be a series of calls to split, each yielding an empty slice. So the whole iterator yields a slice pointing at a, then a slice pointing at b—but it’s had to handle three intermediate slices to get the b. Right?
LegionMammal978|7 months ago
(But as mentioned, this doesn't perform any allocations, since each slice is just a pointer + length into the original string.)