First, stitching strings
1. Use "| |" To stitch Strings:
Select ' Stitching ' || ' string ' as Str from student;
2, using the concat (PARAM1,PARAM2) function to achieve:
Select concat (' concatenation ',' string 'asStr from student;
Note: Oracle's Concat () method supports only two parameters, and if you stitch multiple parameters, you can nest concat ():
Select concat (concat (' concatenation ',' string '),' AB'asStr from student;
Ii. Interception of strings
SUBSTR (String,start_position,[length]), get substring
String: Source string
Start_position: Start position
Length: string lengths [optional]
1substr ("ABCDEFG",0);//return: ABCDEFG, intercept all characters2substr ("ABCDEFG",2);//return: CDEFG, intercept all characters after starting with C3substr ("ABCDEFG",0,3);//return: ABC, intercept starting from a 3 characters4substr ("ABCDEFG",0, -);//return: abcdefg,100 The maximum number of preprocessed strings is returned, although it exceeds the length of the preprocessed string, but does not affect the return result. 5substr ("ABCDEFG",-3);//Back to: EFG, note parameters-3, a negative value indicates that the string is positioned unchanged from the beginning of the tail.
Third, find the string
INSTR (string,substring,position,ocurrence) Find string position
String: Source string
SubString: substring to find
Position: Where to find start
Ocurrence: A substring of the first occurrence of a source string
Select INSTR ('CORPORATEfloor','OR'32as from
Iv. replacing strings
Replace (strsource, STR1, STR2) replaces str1 in strsource with str2
Strsource: Source string
STR1: the string to replace
STR2: Replaced string
Select ' Replace string ' as Replace (' replace string ' ' replace ' ' modify ' as from dual
Note: This article refers to the original: https://www.cnblogs.com/smallrock/p/3507022.html
Oracle string manipulation: stitching, replacing, intercepting, finding