join Function

join produces a string by concatenating all of the elements of the specified list of strings with the specified separator.

join(separator, list)


> join("-", ["foo", "bar", "baz"])
> join(", ", ["foo", "bar", "baz"])
foo, bar, baz
> join(", ", ["foo"])

Related Functions

  • split performs the opposite operation: producing a list by separating a single string using a given delimiter.