string.join
This function converts an array to its string representation and concatenates its elements using the specified separator between each element.
Syntax
string.join(items, separator)
Arguments
|
Argument |
Type |
Description |
|---|---|---|
|
items |
array |
Elements of array |
|
separator |
string |
Separator to be used between each array element |
Returns
|
Type |
Description |
|---|---|
|
string |
Concatenated string representation of the array with the specified separator between each array element. |
Examples
The function string.join(array.create("a", "b"), "-") returns a-b.