Oracle character functions

Source: Internet
Author: User

UPPER (char) lowercase to uppercase


LOWER (char) uppercase to lowercase


Initcap (char) First letter conversion


SUBSTR (Char,[m[,n]]) to intercept string functions
Start interception from the source string char m, intercept n bits you can omit, represent intercept to the end
M is 0, which means the first letter of the punch string is truncated. M is a negative number, indicating the trailing intercept of the punch string
Example:
Sql> Select substr (' ABCDE ', 2,3), substr (' ABCDE ', 2), substr (' ABCDE ', -2,1) from dual;

SUB SUBS S
--- ---- -
BCD BCDE D

Sql> Select substr (' ABCDE ', 2,3), substr (' ABCDE ', 2), substr (' ABCDE ', -2,2) from dual;

SUB SUBS SU
--- ---- --
BCD Bcde de


Length (char) to get string lengths


CONCAT (CHAR1,CHAR2) string Join function
with | | The function of the operator is the same

To remove a substring function:
TRIM (C2 from C1)
This function represents the removal of characters from the string C1 c2

TRIM (C1)
Trim has only one parameter, which represents the trailing and trailing spaces


Remove from head
RTRIM (C1[,C2])
Remove from tail

Replace (char,s_string[,r_string]) Replacement function

Instance:
sql> Select replace (' abced ', ' a ', ' a ') from dual;

Repla
-----
abced

sql> Select replace (' abced ', ' a ') from dual;

Repl
----
bced

sql> Select replace (' abced ', ' ab ', ' A ') from dual;

Repl
----
aced

Oracle character functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.