"Sputnik" help  
Sputnik Help
BinaryJoin(<value/s>, [<separator>], [<start>],<[count]>)

Description

Joins multiple binary strings into a single binary string, optionally separated by a specified separator.

Parameters

<value/s> The binary string(s) to be joined. It can be a single binary string or an array of binary strings.
<separator> Optional separator to be inserted between each value. It defaults to an empty binary string.
<start> Optional starting index from which the values should be joined. It determines the position in the value/s array to start joining. It defaults to 0.
<count> Optional number of values to include in the join operation, starting from the start index. It defaults to the total number of values in the values array.

Return Value

Success: Returns the joined binary string containing the concatenated values.
Failure: Returns an empty binary string.

Remarks

If the value/s parameter is an array, all elements of the array will be converted to binary strings and joined together.
The start parameter allows you to specify the starting index from which the values should be joined. Values before the start index will be excluded from the joining process.
The count parameter determines the number of values to include in the join operation. If the count is greater than the available values, it will be adjusted to the maximum available values.
The resulting binary string will not contain the separator at the beginning or end.
If any of the input parameters are null or empty, the function will return an empty binary string.

Related

BinaryAppend, BinaryConcat

Example

Example of usage:

$a = BinaryJoin("Cat");
say $a;
$a = BinaryJoin("Cat", "-");
say $a;
$a = BinaryJoin(array("Cat", "Dog", "Fox"), "-");
say $a;
$a = BinaryJoin(array("Cat", "Dog", "Fox"), "-", 1, 2);
say $a;
$a = BinaryJoin(array("Cat", "Dog", "Fox"), "-", 1, 1);
say $a;
$a = BinaryJoin(array("Cat", "Dog", "Fox"), "-", 2, 1);
say $a;

// PRINTS
// Cat
// Cat
// Cat-Dog-Fox
// Dog-Fox
// Dog
// Fox

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org