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

    SELECT
    SUBSTR('ABCDEFG',3,4),
    SUBSTR('ABCDEFG',3),
    SUBSTR('ABCDEFG',-3,3),
    UPPER('jinhong'),
    lower('X-DEF'),
    REPLACE('JACK and JUE','J','BL'),
    REPLACE('JACK AND LIFE', 'jack'),
    REPLACE('JACK AND LIFE', 'JACK'),
    LENGTH('BLAKE'),
    INSTR('www.life.com.www', 'www.'),
    INSTR('www.life.com.www', 'www',2),
    'ONE'||'TWO'
    
    FROM dual;
    SUBSTR('ABCDEFG',3,4) SUBSTR('ABCDEFG',3) SUBSTR('ABCDEFG',-3,3) UPPER('JINHONG') LOWER('X-DEF') REPLACE('JACKANDJUE','J','BL') REPLACE('JACKANDLIFE','JACK') REPLACE('JACKANDLIFE','JACK') LENGTH('BLAKE') INSTR('WWW.LIFE.COM.WWW','WWW.') INSTR('WWW.LIFE.COM.WWW','WWW',2) 'ONE'||'TWO'
    --------------------- ------------------- ---------------------- ---------------- -------------- ------------------------------ ----------------------------- ----------------------------- --------------- -------------------------------- --------------------------------- ------------
    CDEF                  CDEFG               EFG                    JINHONG          x-def          BLACK and BLUE                 JACK AND LIFE                  AND LIFE                                   5                                1                                14 ONETWO       


    SUBSTR:
    Extracts a portion of a string.
    Syntax:
    SUBSTR(original_string,position[,substring_length])
    It returns a portion of original_string, beginning at
    If position is negative Oracle counts backward from the end of
    The substring_length parameter is optional. If it is omitted, the function returns
    UPPER:
    Returns the string with all letters uppercase.
    Syntax:
    UPPER(original_string)
    LOWER:
    Returns the string with all letters lowercase.
    Syntax:
    LOWER(original_string)
    INITCAP:
    Returns the string with the first letter of each word in uppercase, all other letters in lowercase.
    Syntax:
    INITCAP(original_string)
    REPLACE:
    Returns the string with every occurrence of search_string
    then all occurrences of search_string are removed
    Syntax:
    REPLACE(original_string,search_string,replacement_string)
    LENGTH:
    Returns the length of the string.
    Syntax:
    LENGTH(string)
    INSTR:
    Returns the position in which one string is found within another string.
    Syntax:
    INSTR(main_string,substring[,position[,occurrence]]
     

  • 相关阅读:
    ThinkPHP函数详解:C方法
    ThinkPHP函数详解:A方法
    php中的中文字符串长度计算以及截取
    JQ $("#form1 :input" ).length 与 $("#form1input").length有什么区别?
    php中的isset和empty的区别与认识
    谈谈ACM带来的一些东西
    HDU 4374--F(x)
    奖学金
    数字排序
    查找数字
  • 原文地址:https://www.cnblogs.com/kakaisgood/p/9566147.html
Copyright © 2011-2022 走看看