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

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