Explorer

std.string-join-from

description
Join the strings from index with separator after accum (start with index 0 and accum "")
type
Fn(items: List<String>, separator: String, index: Number, accum: String) -> String
expression
fn(items$0, separator$1, index$2, accum$3) =>
  match @core.list-get(list: $0, index: $2) {
    #none(_) =>
      $3,
    #some(item$4) =>
      @std.string-join-from(
        items: $0,
        separator: $1,
        index: @core.plus(left: $2, right: 1),
        accum: match @core.equal(left: $2, right: 0) {
          true =>
            $4,
          false =>
            @core.string-concat(left: @core.string-concat(left: $3, right: $1), right: $4)
        }
      )
  }
visibility
public
std.string-join-from (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: VS4olNGfwrxTaoY0fkEtIzwa0qKwBCra4b2n5TgCusc
content hash: xqNTgtFONd_1W5fBIDzH4ISmC6CasVQ_NEMqCJY2VaE