---
schema_version: "1"
id: 56347fea037cec3680ba476c1d5cac2a1c7bf0e51d8f100b34f7aca6095a62d3
title: splitWhere
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-arrays-functions-splitwhere.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-arrays-functions-splitwhere
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0011107876dbda776e9167c0fc4a366071f45bc5e1fbcbf92041313929166cff
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# splitWhere

## [](#splitwhere1)splitWhere<T>(array: Array<T>, condition: (item: T) -> Boolean): Pair<Array<T>, Array<T>>

配列を、条件を満たす最初の位置で 2 つに分割します。

_DataWeave バージョン 2.2.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>array</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>condition</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">配列の要素の照合に使用される条件 (式)。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

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

```DataWeave
%dw 2.0
import * from dw::core::Arrays
output application/json
var users = ["Mariano", "Leandro", "Julian", "Tomo"]
---
users splitWhere (item) -> item startsWith "Jul"
```

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

```json
{
  "l": [
    "Mariano",
    "Leandro"
  ],
  "r": [
    "Julian",
    "Tomo"
  ]
}
```

## [](#splitwhere2)splitWhere(array: Null, condition: (item: Nothing) -> Any): Null

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

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