std-strjoin


Synopsis

(std-strjoin <lst> <delim>)

Description

STD-STRJOIN combines a list of lisp expressions to a string seperated by a delimiter string.

It is the exact complement to std-strsplit, a complete roundtrip

(STD-STRJOIN (STD-STRSPLIT s d) d) is possible.

Each element of lst is converted to a string by STD-PRINC-TO-STRING, so the elements of lst don't necessarily have to be of type string, though it will work faster if all elements are strings.

Examples

(std-strjoin ("" "1" "2") ",") 	=> ",1,2"
(std-strjoin ("" 1 2) ",") 	=> ",1,2"

(std-strjoin (std-strsplit input ",") ";") => replaces the delimiter from "," to ";"

(std-strjoin '(0 1 2 3) ",") 	=> "0,1,2,3"
(std-strjoin (std-int-list 4) ",") => "0,1,2,3"

Arguments

lst: a list.

delim: a string.

Return Value

A string.

Side Effects

None.

Module

(std-require 'STDSTR)

Defined in STDSTR