> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ENDSWITH

> Tests whether a string ends with another string.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

**Aliases:** [`ends_with`](/query/sql/functions/string/ends_with)

Returns NULL if either argument is NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
endswith(value, search)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | The string to inspect. |
| search | STRING | Yes | The substring to find. |

## Returns

* Type: BOOLEAN
* Possible values: TRUE or FALSE from a case-sensitive literal substring comparison.
* NULL behavior: Returns NULL if either argument is NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT endswith('abc', 'bc') AS found, endswith('abc', '') AS empty_search;
```

| found | empty\_search |
| - | - |
| true | true |

### Case-sensitive suffixes

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT endswith('report.csv', '.csv') AS csv_file, endswith('report.CSV', '.csv') AS different_case;
```

| csv\_file | different\_case |
| - | - |
| true | false |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.