---
schema_version: "1"
id: e0e482d1c61f8990ef0f51553bd841f0eb12ffe693a036386796a33860f2ca14
title: toArray
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-coercions-functions-toarray.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-coercions-functions-toarray
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6b6817f848d4b6b13fc63e19832a13849674cacc991706e74d2629be97e1c9f0
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# toArray

## [](#toarray1)toArray(@StreamCapable text: String): Array<String>

`String`​ 値を文字の ​`Array`​ に分割します。

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

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

<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>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">文字の ​<code>Array</code>​ に変換する ​<code>String</code>​ 値 (​<code>Array&lt;String&gt;</code>​ 型)。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`toArray`​ の動作を示します。

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

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/json indent=false
---
{
  a: toArray(""),
  b: toArray("hola")
}
```

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

```Json
{"a": [],"b": ["h","o","l","a"]}
```