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]]
     

  • 相关阅读:
    Java并发包中Lock的实现原理
    多线程---再次认识volatile,Synchronize,lock
    共享锁(S锁)和排它锁(X锁)
    Java 7中的TransferQueue 以及 SynchronousQueue
    精巧好用的DelayQueue
    非阻塞同步算法与CAS(Compare and Swap)无锁算法
    彻底理解线索二叉树
    使用import取代require
    子页面iframe跨域执行父页面定义的JS方法
    利用js实现 禁用浏览器后退
  • 原文地址:https://www.cnblogs.com/kakaisgood/p/9566147.html
Copyright © 2011-2022 走看看