Skip to content

StringUtils.join

Signature: StringUtils.join(separator*)

Returns: String result - the array elements joined as a single string

Join all elements in the array into a single string.

Parameters

Type Name Description Default
String separator* (optional) the string of characters to put in between each of the elements of the array in newly joined string ,

Example

var theArray = ['Apple', 'Orange', 'Grapefruit', 'Grape'];
StringUtils.join(theArray);         // AppleOrangeGrapefruitGrape
StringUtils.join(theArray, ':');    // Apple:Orange:Grapefruit:Grape
StringUtils.join(theArray, ',');    // Apple,Orange,Grapefruit,Grape