---
schema_version: "1"
id: f324a5487c6935de753cca57fd74d111f4e21844f5e0ed204208b888be13df50
title: dropWhile
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-arrays-functions-dropwhile.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-arrays-functions-dropwhile
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4d0f0b7fd7b5a61609244a4059ac389fefca120e39d270e4063c916c51c5983d
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# dropWhile

## [](#dropwhile1)dropWhile<T>(array: Array<T>, condition: (item: T) -> Boolean): Array<T>

条件を満たす場合に要素を配列から削除しますが、条件を満たさない要素に達したら選択プロセスを停止します。

_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>

### [](#例)例

次の例では、​`2`​ 以下の要素を省略する配列を返します。 最後の 2 つの要素 (​`2`​ と ​`1`​) が出力配列に含まれます。これは、​`3`​ (​`2`​ より大きい) に達した時点で関数が要素の削除を停止するためです。

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

```DataWeave
%dw 2.0
import * from dw::core::Arrays
output application/json
var arr = [0,1,3,2,1]
---
arr dropWhile $ < 3
```

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

```json
[
  3,
  2,
  1
]
```

## [](#dropwhile2)dropWhile(array: Null, condition: (item: Nothing) -> Any): Null

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

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