---
schema_version: "1"
id: 4680697d5678b2ebeaecff559505e5dc5a19ff33eec825f65953dfd9520bb48a
title: joinBy
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-core-functions-joinby.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-core-functions-joinby
source_site: docs.mulesoft.com
content_type: documentation
content_hash: bc8f5b2ee1e3f6533f870377d3cd7fc181dbbf2307b6d3abe92128ad88773f15
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# joinBy

## [](#joinby1)joinBy(elements: Array<StringCoerceable>, separator: String): String

配列を 1 つの文字列値にマージし、指定された文字列をリストの各項目間の区切り文字として使用します。

`joinBy`​ は ​`splitBy`​ と逆の操作を実行します。

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>elements</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力配列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>separator</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">リストの要素を結合するために使用する ​<code>String</code>​ (文字列)。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、ハイフン (​`-`​) で要素を結合します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
output application/json
---
{ "hyphenate" : ["a","b","c"] joinBy "-" }
```

#### [](#出力)出力

```JSON
{ "hyphenate": "a-b-c" }
```

## [](#joinby2)joinBy(n: Null, separator: Any): Null

`joinBy`​ を ​`null`​ 値に使用できるようにするヘルパー関数。

_DataWeave バージョン 2.4.0 で導入されました。_