---
schema_version: "1"
id: 05fe381bf07f57d9aa6555fa104c548a29cb0e6bb524615f8f01886be396db12
title: joinBy
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-core-functions-joinby.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-core-functions-joinby
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e46e0d7285543faf29dc94781e0bb986cd236f7ccdbc3805fd40650d5467dd95
description: MuleSoft Documentation Site
release: "2.4"
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 で導入されました。_​