There is a flag -n/--no-empty for string split that excludes empty result items.
There should be an analogous flag for string join that does not add the delimiter next to an empty item.
~$ string join -n + a b "" c
string join + a b "" c
a+b+c
a+b++c
~$ read x; for o in {-n,}
string join $o -- - a $x (string sub -s 3 $x) b
end
read> iy
a-iy--b
a-iy-b
There is a flag
-n/--no-emptyforstring splitthat excludes empty result items.There should be an analogous flag for
string jointhat does not add the delimiter next to an empty item.