Concatenates a specified separator string between each element of a specified string array, yielding a single concatenated string
Class: String
Parameters: $array – String array
$sep (Optional) – Single character string to be used for the separator. Default $sep is comma character
$quote (Optional) – String to be used as the quotation. Must embody $sep if used. Default $quote is double quote
Syntax: $returnString=$token($array [,$sep [,$quote]])
Returns: A string consisting of the elements of $array interspersed with the $sep string
Remarks: Returns “” if $array is not one-dimensional
Example:
//Example for the string $left method
array $MyArray //Declare 1 dimensional string array
$MyArray[0]=”A” //Set first element
$MyArray[1]=”B” //Set second element
$MyArray[2]=”C” //Set third element
$result=$token($MyArray, “|“) //Result (= ‘A|B|C’)
message(“Concatenation of array elements is “ + $result) //Display results message