zoukankan      html  css  js  c++  java
  • 字符串函数

    mysql> select ascii("w");
    +------------+
    | ascii("w") |
    +------------+
    |        119 |
    +------------+
    1 row in set (0.00 sec)
    
    mysql> select char(119);
    +-----------+
    | char(119) |
    +-----------+
    | w         |
    +-----------+
    1 row in set (0.00 sec)
    
    mysql> select repeat("w",10);
    +----------------+
    | repeat("w",10) |
    +----------------+
    | wwwwwwwwww     |
    +----------------+
    1 row in set (0.00 sec)
    
    
    mysql> select length("是");
    +---------------+
    | length("是")  |
    +---------------+
    |             3 |
    +---------------+
    1 row in set (0.17 sec)
    
    mysql> select char_length("是"); 
    +--------------------+
    | char_length("是")  |
    +--------------------+
    |                  1 |
    +--------------------+
    1 row in set (0.00 sec)
    
    mysql> select concat("a","b");
    +-----------------+
    | concat("a","b") |
    +-----------------+
    | ab              |
    +-----------------+
    1 row in set (0.00 sec)
    
    
    mysql> select lower("A");
    +------------+
    | lower("A") |
    +------------+
    | a          |
    +------------+
    1 row in set (0.00 sec)
    
    mysql> select upper("a");
    +------------+
    | upper("a") |
    +------------+
    | A          |
    +------------+
    1 row in set (0.00 sec)
    
    mysql> select instr("this is test","test");
    +------------------------------+
    | instr("this is test","test") |
    +------------------------------+
    |                            9 |
    +------------------------------+
    1 row in set (0.00 sec)
    
    mysql> select instr("this is test","t");
    +---------------------------+
    | instr("this is test","t") |
    +---------------------------+
    |                         1 |
    +---------------------------+
    1 row in set (0.00 sec)
    
    
    mysql> select left("abcdef",2);
    +------------------+
    | left("abcdef",2) |
    +------------------+
    | ab               |
    +------------------+
    1 row in set (0.00 sec)
    
    mysql> select right("abcdef",2);    
    +-------------------+
    | right("abcdef",2) |
    +-------------------+
    | ef                |
    +-------------------+
    1 row in set (0.00 sec)
    
    

    mysql> select replace("abcdef","abc","ABC"); +-------------------------------+ | replace("abcdef","abc","ABC") | +-------------------------------+ | ABCdef | +-------------------------------+ 1 row in set (0.00 sec) mysql> select trim(" abcd "); +----------------+ | trim(" abcd ") | +----------------+ | abcd | +----------------+ 1 row in set (0.00 sec)
  • 相关阅读:
    利用Telnet来模拟Http请求 有GET和POST两种
    WebConfig特殊字符的转义!
    userprofile同步用户失败的原因和解决方案
    linux mysql表名大小写
    web.py 中文模版报错
    docker 开启远程
    web.py 笔记
    python 安装influxdb-python
    安装pip
    influxdb 命令
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5619316.html
Copyright © 2011-2022 走看看