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

# starts_with

> 如果字符串以指定前缀开头返回1，否则返回0。

如果字符串以指定前缀开头返回 1，否则返回 0，任意参数为 NULL 则返回 NULL。

## 语法

```Haskell theme={null}
starts_with(str, prefix)
```

## 参数说明

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

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

## 返回值说明

返回值的数据类型为 BOOLEAN。

## 示例

```Plain Text theme={null}
mysql> select starts_with("hello world","hello");
+-------------------------------------+
|starts_with('hello world', 'hello')  |
+-------------------------------------+
| 1                                   |
+-------------------------------------+

mysql> select starts_with("hello world","world");
+-------------------------------------+
|starts_with('hello world', 'world')  |
+-------------------------------------+
| 0                                   |
+-------------------------------------+
```


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