---
name: "joinString"
type: command
status: ok
groups: ["Strings"]
arma3_since: "1.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/joinString
revid: 377091
updated: 2026-01-01T09:48:22Z
---

# joinString

*Command · Strings · Arma 3 v1.50*

## Description

Joins *array* into [String](../topics/String.md) with provided *separator*. Array can be of mixed types, all elements will be converted to [String](../topics/String.md) prior to joining, but the fastest operation is on the array of [String](../topics/String.md)s.

## Syntax

```sqf
array joinString separator
```

**Parameters:**

- `array`: [Array](../topics/Array.md) of [Anything](../topics/Anything.md)
- `separator`: [String](../topics/String.md) - separator used to join array elements.

**Returns:** [String](../topics/String.md)

## Examples

### Example 1

```sqf
_str = "- This, is a sample string." splitString "-,. "; // ["This","is","a","sample","string"]
_str joinString " "; // "This is a sample string"
```

### Example 2

```sqf
["This","is","sparta"] joinString " ~ "; // "This ~ is ~ sparta"
```

### Example 3

```sqf
["1",2,text "3"] joinString ""; // "123"
```

### Example 4

```sqf
"Japa is the best!" splitString "" joinString " "; // "J a p a   i s   t h e   b e s t !"
```

### Example 5

Remove all \r\n from file:

```sqf
loadFile "somefile.txt" splitString toString [13,10] joinString " "
```

## See also

[splitString](../commands/splitString.md) · [set](../commands/set.md) · [resize](../commands/resize.md) · [reverse](../commands/reverse.md) · [select](../commands/select.md) · [in](../commands/in.md) · [find](../commands/find.md) · [toArray](../commands/toArray.md) · [forEach](../commands/forEach.md) · [count](../commands/count.md) · [deleteAt](../commands/deleteAt.md) · [deleteRange](../commands/deleteRange.md) · [append](../commands/append.md) · [sort](../commands/sort.md) · [param](../commands/param.md) · [params](../commands/params.md) · [arrayIntersect](../commands/arrayIntersect.md) · [toString](../commands/toString.md) · [endl](../commands/endl.md)

<sub>Source: [BI Community Wiki — joinString](https://community.bistudio.com/wiki/joinString) (revision 377091).</sub>
