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

# endsWith

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

## endsWith(text: String, suffix: String): Boolean

Returns `true` if a string ends with a provided substring, `false` if not.

### 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 (a <code>String</code>).</p></td></tr><tr><td><p><code>suffix</code></p></td><td><p>The suffix string to find at the end of the input string.</p></td></tr></tbody></table>

### Example

This example finds "no" (but not "to") at the end of "Mariano".

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ "Mariano" endsWith "no", "Mariano" endsWith "to" ]
```

#### Output

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

## endsWith(text: Null, suffix: Any): false

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

_Introduced in DataWeave version 2.4.0._
