Add some string functions document (#928)

This commit is contained in:
ZHAO Chun
2019-04-16 10:14:49 +08:00
committed by GitHub
parent e5a5b6da16
commit cdd613c5a4
12 changed files with 237 additions and 16 deletions

View File

@ -0,0 +1,27 @@
# instr
## Syntax
`INT instr(VARCHAR str, VARCHAR substr)`
## Description
返回 substr 在 str 中第一次出现的位置(从1开始计数)。如果 substr 不在 str 中出现,则返回0。
## Examples
```
mysql> select instr("abc", "b");
+-------------------+
| instr('abc', 'b') |
+-------------------+
| 2 |
+-------------------+
mysql> select instr("abc", "d");
+-------------------+
| instr('abc', 'd') |
+-------------------+
| 0 |
+-------------------+
```