I sense flawed decision-making here.  If blanks is false (i.e. we're excluding empty strings from the list produced) then the not-last-item code won't increment count, so wouldn't have brought count to max here.  So I think split(":::a::::b::::c:::", ":", 3, false) shall return { "a", "b" } rather than the { "a", "b", "c" } that I think you expect.