---
schema_version: "1"
id: 95e74ed0f82fac0fffeb862638841f9b38d540faed842edbedc75e36e9f2089a
title: startsWith
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-core-functions-startswith.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-core-functions-startswith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1f7436e19c3bcb87648811ae3b1ae9733dd6054bdeb8050c596799ef4f04ffa5
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# startsWith

## [](#startswith1)startsWith(text: String, prefix: String): Boolean

入力文字列が照合するプレフィックスで始まるかどうかによって ​`true`​ または ​`false`​ を返します。

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

<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>prefix</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">プレフィックスを識別する文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、文字列が指定したプレフィックスで始まるかどうかを示します。 `startsWith(text,prefix)`​ または ​`text startsWith(prefix)`​ 表記 (​`startsWith("Mari","Mar")`​、​`"Mari" startsWith("Mar")`​ など) を使用できます。

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

```DataWeave
%dw 2.0
output application/json
---
[ "Mari" startsWith("Mar"), "Mari" startsWith("Em") ]
```

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

```JSON
[ true, false ]
```

## [](#startswith2)startsWith(text: Null, prefix: Any): false

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

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