---
schema_version: "1"
id: b46e68249fee8d329b38dcef92a1ac84acd0a197cab0e6f215f5db0dfcfd0e95
title: startsWith
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-core-functions-startswith.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-core-functions-startswith
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b61c7b396c05c87e19ff936cfe5973d46e6c6a35ae9a603690dacded5b8efce2
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# startsWith

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## startsWith(text: String, prefix: String): Boolean

Returns `true` or `false` depending on whether the input string starts with a matching prefix.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>text</code></p></td><td><p>The input string.</p></td></tr><tr><td><p><code>prefix</code></p></td><td><p>A string that identifies the prefix.</p></td></tr></tbody></table>

### Example

This example indicates whether the strings start with a given prefix. Note that you can use the
`startsWith(text,prefix)` or `text startsWith(prefix)` notation (for example,
`startsWith("Mari","Mar")` or `"Mari" startsWith("Mar")`).

#### Source

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

#### Output

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

## startsWith(text: Null, prefix: Any): false

Helper function that enables `startsWith` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
