未验证 提交 cbd2f1d8 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #7112 from godfreyd/godfreyd-startswith

Docs(startsWith): Fix startsWith function
......@@ -152,9 +152,34 @@ Similar to base64Decode, but in case of error an empty string would be returned.
Returns whether to end with the specified suffix. Returns 1 if the string ends with the specified suffix, otherwise it returns 0.
## startsWith(s, prefix) {#function-startswith}
## startsWith(str, prefix) {#function-startswith}
Returns whether to start with the specified prefix. Returns 1 if the string starts with the specified prefix, otherwise it returns 0.
Returns 1 whether string starts with the specified prefix, otherwise it returns 0.
```sql
SELECT startsWith('Spider-Man', 'Spi');
```
**Returned values**
- 1, if the string starts with the specified prefix.
- 0, if the string doesn't start with the specified prefix.
**Example**
Query:
```sql
SELECT startsWith('Hello, world!', 'He');
```
Result:
```text
┌─startsWith('Hello, world!', 'He')─┐
│ 1 │
└───────────────────────────────────┘
```
## trimLeft(s)
......
......@@ -124,11 +124,37 @@ SELECT format('{} {}', 'Hello', 'World')
Возвращает 1, если строка завершается указанным суффиксом, и 0 в противном случае.
## startsWith(s, prefix) {#function-startswith}
## startsWith(str, prefix) {#function-startswith}
Возвращает 1, если строка начинается указанным префиксом, и 0 в противном случае.
Возвращает 1, если строка начинается указанным префиксом, в противном случае 0.
```sql
SELECT startsWith('Spider-Man', 'Spi');
```
**Возвращаемые значения**
- 1, если строка начинается указанным префиксом.
- 0, если строка не начинается указанным префиксом.
**Пример**
Запрос:
```sql
SELECT startsWith('Hello, world!', 'He');
```
Ответ:
```text
┌─startsWith('Hello, world!', 'He')─┐
│ 1 │
└───────────────────────────────────┘
```
## CRC32(s)
Возвращает чексумму CRC32 данной строки.
Тип результата - UInt32.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册