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

# startsWith

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

## startsWith(String, 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 ]
```
