Skip to content

Suggestion: -n flag for string join mirroring string split #8351

@schuelermine

Description

@schuelermine

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions