Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fstring%2Fendswith.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fstring%2Fendswith.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `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://docs-docusaurus.kinsta.page/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

}
```
