<div class="meta" robots="noindex">

</div>

Method

# Join

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `String.FromArray<string.fromarray>` as a replacement.

</div>

## Description

Assigns a value to a `String</api/data_types/string>` variable by concatenating the elements of a one-dimensional `String</api/data_types/string>` array.

## Usage

*result* = **Join**(*sourceArray* \[,*delimiter*\])

| Part            | Type                                   | Description                                                                                                                              |
|-----------------|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| **result**      | `String</api/data_types/string>`       | `String</api/data_types/string>` that results from concatenating all the elements of *sourceArray*, optionally separated by *delimiter*. |
| **sourceArray** | `String</api/data_types/string>` array | Source array whose elements will be used to create *result*.                                                                             |
| **delimiter**   | `String</api/data_types/string>`       | Optional delimiter used in separating the elements of *sourceArray* when creating *result*. The default is one space.                    |

## Notes

Join takes a one-dimensional `String</api/data_types/string>` array and concatenates the individual elements into a single `String</api/data_types/string>` variable. You can pass an optional delimiter which will be inserted between the fields in the resulting `String</api/data_types/string>`. If no delimiter is passed, a single space will be used as the delimiter.

The `String.Split<string.split>` function performs the opposite function. It takes a `String</api/data_types/string>` and creates an array by parsing the string into array elements using a specified delimiter.

## Sample code

This example concatenates a three-element array into the string "Anthony,Aardvark,Accountant".

``` xojo
Dim names() As String = Array("Anthony", "Aardvark", "Accountant")
Dim combinedNames As String = Join(names, ",") ' returns "Anthony,Aardvark,Accountant"
```

## Compatibility

All project types on all supported operating systems.

## See also

`Dim</api/language/dim>` statement; `Array</api/language/array>`, `String<string.nthfield>`, `String<string.split>`, `Arrays<arrays.lastindex>`, `Text<text.join>`, `Text<text.split>`, functions; `Arrays<arrays.add>`, `Arrays.IndexOf<arrays.indexof>`, `Arrays<arrays.addat>`, Pop, `Redim</api/language/redim>`, `Arrays<arrays.removeat>`, `Shuffle</api/language/shuffle>`, `Sort<arrays.sort>`, Sortwith methods; `ParamArray</api/language/paramarray>` keyword; `Arrays</api/language/arrays>` concept
