---
title: endsWith
description: |
  Returns `true` if a string ends with a given substring, otherwise return `false`.

  !!! note
      Unlike `contains`, which checks for a substring anywhere in the string, `endsWith` only matches the end.
url: https://coralogix.com/docs/dataprime/language-reference/functions-reference/string/endswith/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `endsWith`

## Description

Returns `true` if a string ends with a given substring, otherwise return `false`.

Note

Unlike `contains`, which checks for a substring anywhere in the string, `endsWith` only matches the end.

## Syntax

Like many functions in DataPrime, `endsWith` supports<!-- --> [two notations](https://coralogix.com/docs/dataprime/language-reference/functions-reference.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
endsWith(value: string, suffix: string): bool
```

```
(value: string).endsWith(suffix: string): bool
```

## Arguments

| Name     | Type     | Required | Description                                          |
| -------- | -------- | -------- | ---------------------------------------------------- |
| `value`  | `string` | **true** | The string to test                                   |
| `suffix` | `string` | **true** | The substring to match against the end of the string |

## Example

**Check if an AWS ARN refers to a known S3 bucket**

AWS S3 ARNs look like this:

```
arn:aws:s3:::mybucket
```

To verify if the ARN points to `mybucket`, use `endsWith`:

### Example query

* Function notation
* Method notation

```
create is_my_bucket from endsWith(arn, 'mybucket')
```

```
create is_my_bucket from arn.endsWith('mybucket')
```

### Example output

```
{

    "arn": "arn:aws:s3:::mybucket",

    "is_my_bucket": true

}
```
