ListAppend

Concatenates a list or element to a list.

ListAppend( list, value [, delimiters ] )

Returns: String

Argument Description Default
list
string, required

a string list

value
string, required

a string value

delimiters
string, optional

Characters that separate list elements. The default value is comma. If this string contains more than one character, only the first character is used.

,

Examples

Example without delimiter argument:

mylist = "one,two,three"; mynewlist = listAppend(mylist, "four"); // Note that listAppend creates a new list. It doesn't update the existing list: writeDump(mylist); writeDump(mynewlist); 

Expected result: one,two,three,four

Example with delimiter argument:

mylist = "foo"; mynewlist = listAppend(mylist, "bar", "|"); writeDump(mynewlist); 

Expected result: foo|bar

See also