@Implode (JavaScript)
Concatenates elements of a text list into a string.
Defined in
@Functions (JavaScript)Syntax
@Implode(textList:any) : string
@Implode(textList:any,
sep:string) : string
Parameter | Description |
---|---|
textList |
Text list to be concatenated. |
sep |
Separates elements in the string. Defaults to the space. |
Return value | Description |
---|---|
string |
The resulting string. |
Usage
A list is an array.Examples
This example implodes a list using a space to separate elements.function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", "London", "Moscow");
var citiesString = @Implode(cities);
p(citiesString); // <<<Paris Berlin London Moscow>>>
This example implodes a list using a comma and space to separate elements.
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", "London", "Moscow");
var citiesString = @Implode(cities, ", ");
p(citiesString); // <<<Paris, Berlin, London, Moscow>>>