string.listPrepend()

Inserts an element at the beginning of a list.

string.listPrepend( value=string, delimiters=string, includeEmptyFields=boolean )

Returns: String

Argument Description
value
string, required

An element or a list of elements.

delimiters
string, optional

Characters that separate list elements. The default value is comma.

Alias: delimiter

includeEmptyFields
boolean, optional

if false it cleans up empty fields.

Examples

fruits = "apple,mango-papaya,lemon,grapes,mango-Apple,Mango-apple,mango";
writeDump(fruits);
res = fruits.listprepend("jerry");
writeDump(res);
res = fruits.listprepend("tomato");
writeDump(res);
res = fruits.listprepend("tomato","-");
writeDump(res);

See also