1. Replace
Replace (x, y, z) returns a result string that replaces the Y-string in string X with a Z-string.
replace (x, y) return value removes the character string x as the Y string
Cases:
Epacel (' aaabbb ', ' BBB ', ' CCC ')
Results: AAACCC
2, length indicates the character of the string
SELECT Length (' Ye Dehua ABC ') from dual;
Results:
--length by character, Chinese, English, numbers are 1 characters, so here return 6
3. LENGTHB represents the byte length of the string;
SELECT LENGTHB (' Ye Dehua ABC ') from dual '
Results:
--length in bytes, I here is UTF-8 encoding, Kanji 3 bytes, English one byte, so here return 12
4, substr means to obtain the substring according to the character length,
SELECT substr (' Ye Dehua abc ', 1,4) from dual;
Results:
--substr by character Intercept, intercept to A, return: Ye Dehua A
5. SUBSTRB means to get a string based on the length of the byte.
SELECT substrb (' Ye Dehua ABC ') from dual;
Results:
--SUBSTRB by Byte, 2 less than one Chinese character length, return: two spaces
SELECT substrb (' Ye Dehua abc ', 1,3) from dual;
--SUBSTRB by Byte intercept, 3 is just a Chinese character length, return: Leaf select SUBSTRB (' Ye Dehua abc ', 1,4) from dual;
--SUBSTRB by Byte, 4 extra kanji less than two kanji, return: contra a space
Replace, length, LENGTHB, substr, SUBSTRB functions in Oracle