---
schema_version: "1"
id: 84a766746af14fa74e1c5e14b4be53579106ea43bbd44369c14d2c25a1dd422e
title: substringBy
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-strings-functions-substringby.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-strings-functions-substringby
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ba4bb6df311c500f92150e7dbd88ac333180f67ee5b2647216b171568d083707
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# substringBy

## [](#substringby1)substringBy(text: String, predicate: (character: String, index: Number) -> Boolean): Array<String>

`predicate`​ 式が ​`true`​ を返すそれぞれの文字で文字列を分割します。

_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">分割する文字列。文字列は文字の配列として扱われます。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>predicate</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">各文字をテストして
                Boolean (ブール) 値を返す式。式は文字列の各文字およびインデックスを反復処理できます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、指定された文字 (`"~"`、 `"="`、 または `"_"`) が存在する場所で文字列を分割します。

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

```DataWeave
%dw 2.0
import substringBy from dw::core::Strings
output application/json
---
"hello~world=here_data-weave" substringBy $ == "~" or $ == "=" or $ == "_"
```

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

```Json
["hello", "world", "here", "data-weave"]
```

## [](#substringby2)substringBy(text: Null, predicate: (character: Nothing, index: Nothing) -> Any): Null

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

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