join

join ( array array , string _separator , default:true _nullIfEmptyString ) : string

Join elements of an array by a glue. ex: join(["a","b"]) retunrs "a,b".

Example


string result = join(["a", "b", "c"]); // returns "a,b,c"

string result = join(["a", "b", "c"], ";"); // returns "a;b;c"

string result = join(["a", null, "c"], ",", false); // returns "a,,c"

string result = join(["a", null, "c"], ",", "ignore"); // returns "a,c"

Parameters

array

The array of elements to join

_separator (optional)

(optional) The separator to use between elements. Default is ','.

_nullIfEmptyString (optional)

[true|false|"ignore"]. If the entry is null, it is replacer by "". Avoid to have something like that : string1,null,string3 (behavior if false). Other possibility: set this parameter to "ignore", the null entry is simply ignored (string1,string3)