I have strings like:
var = This a string, [This is another string]
I would like to have them broken into something like this in PLSQL
var1 = This is string
var2 = This is another string
The comma should not be included if it is like:
, [
Basically this decides if there is another string.
How can I do it?
Thanks in advance 🙂
You could use a combination of
SUBSTRandINSTRto split the string. For example, to obtain the first string, you can use something along these lines:That is, find the index of the separator (
INSTR(var, ',')), and then useSUBSTRto capture everything up to that index. Same applies to the second string.