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

# ends_with

> 判断字符串是否以指定后缀结尾。

如果字符串以指定后缀结尾，返回 true，否则返回 false。任意参数为 NULL 则返回 NULL。

## 语法

```Haskell theme={null}
ENDS_WITH(str, suffix)
```

## 参数说明

`str`: 支持的数据类型为 VARCHAR。

`suffix`: 支持的数据类型为 VARCHAR。

## 返回值说明

返回值的数据类型为 BOOLEAN。

## 示例

```Plain Text theme={null}
MySQL > select ends_with("Hello starrocks", "starrocks");
+-----------------------------------+
| ends_with('Hello starrocks', 'starrocks') |
+-----------------------------------+
|                                 1 |
+-----------------------------------+

MySQL > select ends_with("Hello starrocks", "Hello");
+-----------------------------------+
| ends_with('Hello starrocks', 'Hello') |
+-----------------------------------+
|                                 0 |
+-----------------------------------+
```


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